TonyBenedetti
Hobbyist Programmer & Fabrik Fan
In the Wiki entry for Elements, it looks to me like "elements" has replaced "getElements" but I continue to see code examples in the forums that use "getElements". Does it make a difference or is one simply an alias for the other?
Getting Element's values with JavaScript (top)
To consistently get the value of an element the following code can be used:
- Fabrik 3.0:
Replace the '1' in 'form_1' with your form's ID.Code:Fabrik.blocks['form_1'].formElements.get('tablename___elementname').getValue();
Replace the '1' in 'form_1' with your form's ID.Remember that for elements such as checkboxes, radio buttons and dropdowns will return the selected sub element's values and not their labels
- Fabrik 3.1+:
Code:Fabrik.getBlock('form_1').elements.get('tablename___elementname').getValue();