How do you validate a form if the JavaScript is disabled in the browser?

Luigi Viggiano

You can make data form checks on the server side
My way is to submit form's data to a servlet (or a jsp) that checks everything and if something is wrong it bounces back (thru an exception) the form (filled with inputted datas) with a description of what is wrong (in the message of the exception). Otherwise, if everything is correct the process continues normally.

       _____ (initial page)         
      /     
     | form  | 
     | jsp   |<--
      _____/      
         |         
         |submit    | validation error
         |          | (exception)
     ____V____     /
    /            /
   |  checks   |_/ 
   | (servlet  |
   |  or jsp)  |
    _________/ 
         |
         | validation ok.
         | (forward)
       __V__  
      /     
     |results| 
     |  page |
      _____/      
For details on how to use servlets and JSP see those specific FAQs.
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact