Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
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

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.095 seconds

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started