Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to uncheck a checked checkbox field by Javascript?

800344Apr 25 2005 — edited May 11 2005
Hi,

In the context of JSP/STRUTS, I have defined a text input filed and a checkbox as:

------------------
<script language="javascript">
function clearFields() {
form = document.forms[0];
form.name.value = "";
form.checkbox1.value = false;
}
</script>

<html:text property="name"/>
<html:checkbox property="checkbox1"/>
Reset

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

The reset function is only working for the text field but nnot for the check box: it was not unchecked although I forced "form.checkbox1.value = false;".

Any wisdom for this?

THX

PY
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 8 2005
Added on Apr 25 2005
12 comments
274 views