hmm how about:

document.forms[0].elements['somecheckbox'].checked = false;

any luck with that?

The value property is whats submitted when you submit, so its the checked property your after, but Id have thought that your document.getElementById("somecheckbox") should work? Maybe it needs an explicit id attribute in the tag? (use the styleId attribute of the struts tag if you need to set it)

dnz wrote:

Hi all.

I have a struts form bean to populate data on my JSP page which works
perfectly fine. I use a boolean attribute in my form bean to set the
checkbox control (at page load time) based on the boolean value. I'm
using the <html:checkbox .... struts tag for the checkbox controls.

The problem I'm having is  .... when my javascript is triggered by
some event (onclick, etc.), the script is unable to uncheck (at
runtime) the already checked checkboxes.  The script is able to set
the true/false value to the form bean its just not showing it on my
JSP page.  If I use standard HTML (no JSP / Struts tags) my javascript
works fine.


My javascript goes like this...


code: --------------------------------------------------------------------------------

document.getElementById("somecheckbox").value = false;

// i've also tried this:

document.getElementById("somecheckbox").checked = false;

--------------------------------------------------------------------------------

Any help would be appreciated.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to