Welcome, Guest
Username: Password: Remember me

TOPIC: Different form-validations on the same table

Different form-validations on the same table 09 Dec 2013 18:47 #11793

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hello All

We recently created an online application form for client-signup and stumbled upon an interesting problem. The solution requires an application table which captures client information and status info which should be set by an employee; therefore, we need two forms:
clientapplication_form
statusapplication_form

These work well out of the box or out of the generator. The issue comes when you try to apply validation. The client form must be validated on the address, telephone, email, name, date and "I agree" fields. And as you know, cook can also code this any day of the week by setting "Required" on the table fields. However, if the forms carry different validation fields one would assume that it should be coded manually using the "xxxitem.xml" files and editing the correct "fieldset"; which was initially done for the client form.

Next we edited the "statusapplication -fieldset and tested the second form. And when trying to save the form "boom" it requested inputs for all the fields of the clientapplication-form. We went back to the client form and it called for the required fields of the statusapplication form. Now neither form would save.

We ended the issue by leaving the "xxxitem.xml" file void of validation fields and removing the JDOM calls from the forms. We then coded the form input fields with their validation manually. Only in this way did we resolve the issue and get the different form-validations to play nicely together.

Our Conclusion:
For validation, the cook-framework does not limit its scope to the defined fieldset but uses the entire XML file. Fields which are defined in more than one fieldset within a given file will have unexpected behavior on the form.

This was also submitted in the hope that the creators of the cook generator may see that for greater flexibility "Required" fields should be defined on the forms.

Best regards
V
The administrator has disabled public write access.
Time to create page: 0.101 seconds

Get Started