While it's true that the best place to validate the field data is at the
browser, not all browser's support Java or JavaScript, so you will likely
want to re-validate the data once it get's to the Servlet. Take a look at
the java.text.DateFormat class.
(*Chris*)
----- Original Message -----
From: Welllington Lacerda <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 02, 1999 2:42 PM
Subject: Re: Validating dates using servlet
> Hi, Jeetandra
>
> I think the best way to do it is using a javascript function in your form.
We did use
> javascript functions for many kinds of validations and they are working
good.
>
> When generating a HTML output in your forms put a
>
> out.println("<SCRIPT language=Javascript>");
> out.println(your function...);
> out.println("</SCRIPT>");
>
> Try out
>
> Wellington
> Brazil
>
> Jeetandra Mahtani wrote:
>
> > Hello,
> > I have a form in which users have to enter 5 dates in the format
mm/dd/yy. Is there any way
> > by which a servlet that will handle this form can let the user know if
the date was entered
> > correctly in the format mm/dd/yy ( both 5/5/99 and 05/05/99 should
work ) and if the values
> > for mm,dd, and yy were valid?
> > Thanks,
> > J
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html