"Hoorn, Michiel van" wrote:
>
> It is possible in *any* browser to turn off JavaScript. JavaScript doens't
> work then (duh). What if you validate your form, check if a date-field is
> empty or not with JavaScript.....that check will NOT work then.
>
> What if that datefield is a primary key in your database and you were trying
> to insert something into it and the JavaScript-validation was the only
> validation to check if that datefield was empty or not. That will give you
> an SQLException, won't it.....thus, i think JavaScript is not suitable for
> validating stuff. And if you do think it is, wel that's fine for you.
>


If you design your page (html or jsp) with a validate function to check
a date, and the call to 'submit' command is placed in that function,
when any user disable javascript, his browser doesn't check the date,
nor submit the form. Web app doesn't work, but you don't get an
SQLException and there's no problem with integrity of data base.

Nevertheless, I ususally check data both in client (javascript) and
server (jsp or beans).

Carlos

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to