Use JavaScript like this
<SCRIPT>
function validate(but){
if (but == "But1"){
//button1 code here
} else if (but == "But2"){
//button2 code here
}
}
<SCRIPT>
<form>
<input type="button" name="But1" value="Button1" onClick="validate('But1')">
<input type="button" name="But2" value="Button2" onClick="validate('But2')">
</form>
Hope that helps
Jorge Barrera
Coral Reef Technologies, Inc.
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Angela Chow
Sent: Tuesday, August 29, 2000 5:37 PM
To: [EMAIL PROTECTED]
Subject: jsp and javascript
Hi,
i have a form which have three buttons: delete item,
more line items, and verify orders. In this form, i
have 5 rows which users can fill out 5 orders. I have
already did the validation on each field. I am
wondering if i can have javascript do certain
validation based on the button the user clicks on.
For example, if the user clicks on the verify order
button, i want javascript to validate all the fields
contain valid information; if the user clicks on the
more item item button, i want javascript to valid that
all the rows in the form are filled up.
please help!
Angela
__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
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
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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