Hi! perhaps this can help you:

<script>
function Date_format() {
    if (date_format=true)
        this.document.form_name.submit();
    else
        alert("Error!!!");
}
</script>

...

<input type=button name=xx value=submit onClick='Date_format()'>

Bye!


Marc

Kevin Yeung wrote:

> Hi, all,
>
> How do I write code for a button that does its own things before passing
> data to a servlet? For example, I have <input type=button> and this button
> checks to see the date field has the correct format before submitting it
> to the server. Do I use javascript? Or do I use Java? What do I put in the
> OnClick field of the button? How can I preserve the session?
>
> Thank you.
>
> --
> K
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to