I misread your post. If the checkboxes are in the same form, here is some example javascript code in an HTML page (save it as "example.html", check some boxes, then hit submit. Everything you need to know should be in it. The rest is between you and JavaScript.
<html> <head> <title>title </title> </head> <body> <script language="javascript"> function traverse(frm) { var i = frm.length; alert("size: " + i + " elements"); for ( j = 0 ;j < i ; j++ ) { if ( frm.elements[j].type == "checkbox" ) { alert( "Analyzing type " + frm.elements[j].type + ", named " + frm.elements[j].name + ", value " + frm.elements[j].value + ", checked " + frm.elements[j].checked ); } }; return "david.html"; } </script> <form name="david" action="example.html" onSubmit="traverse(this)"> <input type="checkbox" name="id" value="1">1 <input type="checkbox" name="id" value="2">2 <input type="submit" name="submit" value="submit"> </form> </body> </html> -----Original Message----- From: YuenSun Lam [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 11:49 PM To: Struts Users Mailing List Subject: RE: how to disable submit button when click on checkbox Thanks for the reply. Do you mean change it to onclick="this.form.delete.disabled=true"?It's still not working. The checkbox is not even checked when click on it. David Friedman <[EMAIL PROTECTED]> wrote:Philip, If it is in the same " ... " form tag, try this javascript: this.form.delete.disabled=true -David -----Original Message----- From: Philip [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 11:02 PM To: [EMAIL PROTECTED] Subject: how to disable submit button when click on checkbox I have a question regarding checkbox, how can I disable a certain submit button when click on a checkbox? I tried the following but is not working: onclick="document.formName.delete.disabled=true" /> Also, is there a way I can count how many checkbox are selected in my jsp code? Please kindly help me. --------------------------------- Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------- Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]