This is the modified version of your code that i tried. It works in ie 5.5
and netscape 7.1
<script>
function check(element) {
alert("getting called");
document.myForm.add.disabled = true;
}
</script>
<form action="myAction" name="myForm">
<input type="submit" value="Submit" name="add">
<input type="checkbox" onclick="check(this.myname)"
name="myname" value="myvalue"/>
</form>
-----Original Message-----
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 25, 2003 12:04 PM
To: 'Struts Users Mailing List'
Subject: RE: checkbox onclick event not getting called
try onclick="check(this.myname)"
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 25, 2003 11:20 AM
To: [EMAIL PROTECTED]
Subject: checkbox onclick event not getting called
Hi,
My code is like the following, when I click the checkbox, nothing happened
(the 'add' button suppose to get disabled). I put a alert statment in the
javascript, and didn't get it showed when click the checkbox... seems the
function didn't get called at all, can anybody tell me why? Thanks a lot!
<SCRIPT LANGUAGE="JavaScript">
function check(element) {
alert("getting called");
document.myform.add.disabled = ( element.checked );
}
<html:form action="myAction" name="myForm">
<html:submit propery="add" value="Add"/>
<input type="checkbox" onclick="check(this)" name="myname" value="myvalue"/>
---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]