Calc Element vs Field Element Eval

jmoises

Active Member
Hi Guys, just simple question whats the best aproch to use php code, calc element or field element as eval?

in terms of resources/procesor/speed etc

Thansk
 
Well, the main differences are:

A field element can only have an eval'ed default, ie. it's initial value on a new form. Once a form is created, and edited, it won't run that default. And that default code is run on the server during the initial form load, not on submit (so you don't have access to whatever values the user assigns to other elements).

Whereas a calc element runs the code every time you submit the form (new or edit), and optionally whenever the element is displayed (list or details view).

So the answer is ... it depends what you are trying to achieve. If you can do what you need by just eval'ing a default when a new form is loaded, use a field. If you need to use data from other elements after submission, use a calc.

-- hugh
 
Looks that if i just need to store some data, the field and eval is the best option, of course the calc has more way to use it,!!!
thanks so much
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top