Whenever I include javascript inside a form_##.js file and include this function
the code only gets run the first time the form is loaded in a session. Or is this by design?
According to the Wiki ( http://fabrikar.com/forums/index.php?wiki/form-javascript-objects/#form-events )...
fabrik.form.elements.added (elements) // All elements have been added to the form's formElements property
To duplicate - create a menu item to a fabrik list. Then in a form_##.js file for that list include this code.
Click the menu item and edit a row in the list. Save the form then click the menu item (or edit icon in the list) again.
The js code inside the fabrik.form.elements.added (for me anyhow) is only working when the form is first loaded
Code:
Fabrik.addEvent('fabrik.form.elements.added', function (block) {
[js code here]
});
According to the Wiki ( http://fabrikar.com/forums/index.php?wiki/form-javascript-objects/#form-events )...
fabrik.form.elements.added (elements) // All elements have been added to the form's formElements property
To duplicate - create a menu item to a fabrik list. Then in a form_##.js file for that list include this code.
Code:
Fabrik.addEvent('fabrik.form.elements.added', function (block) {
console.log('start of fabrik.form.elements.added');
alert('this is js code inside fabrik.form.elements.added');
console.log('end of fabrik.form.element.added');
});
The js code inside the fabrik.form.elements.added (for me anyhow) is only working when the form is first loaded