You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bueno Carlos M <Ca...@irs.gov> on 2003/03/13 17:19:01 UTC

RE: [OT] how does Onclick in checkbox work?

not all actions are available to all html elements -- especially in
netscape/mozilla. checkboxes have onfocus, onblur, and onchange, I think.

-----Original Message-----
From: anis_malkan@non.agilent.com [mailto:anis_malkan@non.agilent.com]
Sent: Thursday, March 13, 2003 11:13 AM
To: struts-user@jakarta.apache.org
Subject: how does Onclick in checkbox work?


Hi,

In the following jsp code why don't the eventhandler onclick does not work
for checkbox. 
It works for image, as whenever image is clicked it goes to my Update event
in my class 
derived from DispatchAction. But everytime the checkbox is clicked it just
checks/unchecks 
the box but does not go to event handler.


Thanks
Anis


<html:hidden property="m_sBtnAction" value="unspecified"/>
<html:hidden property="m_sControlId"/>
<html:hidden property="m_sControlBtnAction"/>
<script>
function setBtnAction(sBtnAction, sControlId, sControlBtnAction)
{
	document.forms[0].m_sBtnAction.value = sBtnAction;
	document.forms[0].m_sControlId.value = sControlId;
	document.forms[0].m_sControlBtnAction.value = sControlBtnAction;
}
</script>


<html:image onclick="setBtnAction('Update', '', '');" srcKey="image.Save" />
<html:checkbox property="count_validation_status"
onclick="setBtnAction('Update', '', '');" />

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org