Update an element value using javascript

chrisyork

Member
I am looking for some pointers to get a couple of things working, having trawled the Wiki and forum for hints and tips... using Joomla 3 and Fabrik 3.1

#1b Form with repeating group, with a button one each 'subrecord' to clear the joined element (JobID) - so that I can remove an item from a list (the join uses merged rows)

I followed the Wiki entry on Element Javascript and tried this on the 'on click' for a button.

Code:
var name = Fabrik.getBlock('form_14').formElements.get('comm_tasks___JobID');
name.getRepeatNum().set('')

when I couldn't get it to work I tried with a single form (i.e. no repeat groups) but couldn't get that working . I thought it might be possible to change the value to 5 using the script (and have tested with single quotes inside each of the brackets too):

Code:
var name = Fabrik.getBlock(form_1).formElements.get(comm_tasks___JobID);
name.set(5);

When loading the form I've looked at the source code and found the relevant script:
Code:
Fabrik.blocks['form_1_11'].dispatchEvent('button', 'comm_tasks___removefromjob', 'click', 'var name = Fabrik.getBlock('form_1').formElements.get('comm_tasks___JobID');name.set('5');');

I get the feeling I'm barking up the wrong tree as nothing happens when I click the button on either form!

I freely admit having very limited knowledge of Javascript...

I would appreciate help
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top