File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes validating dynamic forms Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "validating dynamic forms" Watch "validating dynamic forms" New topic
Author

validating dynamic forms

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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
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
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.


A Convergent Visionary ~ Frank's Punchbarrel Blog ~ LinkedIn profile
 
I agree. Here's the link: jrebel
 
subject: validating dynamic forms
 
Similar Threads
Performance issues with mupltiple forms and single submit.
validaton in struts 1.3
Action alias: ActionName-alias-validation.xml with annotation
Using struts and complex forms
Validation for included forms.