I am working on a site where there will be multiple forms generated dynamically. How can I validate the fields in each of the forms if I don't know what fields will be present in each form. I should be able to use javascript but where do I start? I have done basic validating javascripts in the past any examples would be great also... TIA, Blake
Laojar Chuger
Ranch Hand
Joined: Dec 20, 2000
Posts: 111
posted
0
Validation can be done both client side and server side depending on the business logic partition and security policy. I guess you need exact form content as well as business logic to do any of the validations.
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
0
You just need to generate the validation in the same code which generates the fields. How you do this depends on what sort of validation you are doing. If it's just simple stuff like must-be -numeric you can put the validation in line in the field definition, or if it is more complex you may need a two-phase generation process which also generates some javascript "function" definitions at the top of the file or in a separate ".js" file.