This topic is locked
[SOLVED]

 Required fields only clicking a button. Partial save is allowed

1/10/2012 8:38:36 PM
PHPRunner General questions
N
notuo author

Hi. I have this form to fill with many fields. The form is made of tabs. All the fields are eventually required but I have to allow clicking on SAVE as many times they want. After the form is full, they click a button to move forward in the process. Here is when I need to validate for all he fields.
I don't know if there is a easy way to do this. My guess is to have an event in the button and then to check if the fields are filled or not. If all OK move on, if not, display an JS Alert and go back to the form again.
Any other tips?
Thanks in advance

C
cgphp 1/11/2012

In the "Before record added" event you can check if the form is full fill. Return true if so or return false otherwise.

N
notuo author 1/11/2012



In the "Before record added" event you can check if the form is full fill. Return true if so or return false otherwise.


Thanks. This is a chance (in this event) but "check if the form is full fill" is not a direct thing isn't. I have to do it manually for each field. Isn't?

Sergey Kornilov admin 1/11/2012

I think you can loop through the $values array checking each field value. Should not be that difficult.

N
notuo author 1/11/2012



I think you can loop through the $values array checking each field value. Should not be that difficult.


Yes, this is what I called manually. ie not a direct function already programmed in the system.