Is it "elements" or "formElements"?

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:
    Code:
    Fabrik.blocks['form_1'].formElements.get('tablename___elementname').getValue();
    Replace the '1' in 'form_1' with your form's ID.
  • Fabrik 3.1+:
    Code:
    Fabrik.getBlock('form_1').elements.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
 
Of course it was "formElements" -- it says so right in the wiki entry I so carefully quoted.

New life lesson -- "Tony, don't try to engage in rational discourse after 11pm."
 
LOL!

But it was a reasonable question. I think the plan had been to change to just 'elements' in 3.1, but we found so many people had custom code using formElements, we just left it in, and they both reference the same data.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top