talkinggoat
Member
I have created a button that will pass the ID# through the URL, then autofill a field in the form, but I need to get some information from Fabrik. From the details page of a record, I can see the form number and record ID in the URL as index.php/49/2 where 49 is the form, 2 is the record's unique ID and I'm in the record's details page, but how do I access that data, in Fabrik, if the ID is constantly changing?
I know I can see and retrieve the information in the JS console, using
As you can see, I can hard-code the record's information, but the button requires that the ID change from record to record. I can store that as a variable and use it just fine, but what happens when the ID of the record changes and I start looking at another record; details_49_3, for instance? The button will stop working.
I know I can see and retrieve the information in the JS console, using
JavaScript:
Fabrik.getBlock('details_49_2').elements.get('job_types___id').get('value');
As you can see, I can hard-code the record's information, but the button requires that the ID change from record to record. I can store that as a variable and use it just fine, but what happens when the ID of the record changes and I start looking at another record; details_49_3, for instance? The button will stop working.
Last edited: