Is possible create an element in a form, that change value when user save the form?

javier94

Member
I will need to create an element inside a form, this element should do the following..

in a list view... when you'll edit the register.. the value of this element would be "0".. so if the user "save" the form the value for this element would change to "1".. how can i do that without the user change the value???

I mean the user will not change this element, maybe would be "hide" and i only need to change to "1" if the user when fill in the form.. then save the form.. is when the element should change.

what type of element should be the appropiate???

thanks in advance

Javier
 
You need to use a PHP form submission script, running 'onBeforeProcess'.

To set the value of an element ...

Code:
$formModel->updateFormData('yourtable___yourelement', '1', true);

If the element you are updating is read only (for example the ACL settings on it prevent the user from changing it), add a second 'true' (which tells updateFormData() to override a read only ACL) ...

Code:
$formModel->updateFormData('yourtable___yourelement', '1', true, true);

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

Thank you.

Members online

Back
Top