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)
     |  page |
For details on how to use servlets and JSP see those specific FAQs.