I am pretty new to JavaScript and having trouble with something that
should, I think, be fairly easy.
I have one form.
I have two radio buttons.
I have a text box that is hidden.
If you click the radio button that has the value "Yes", the hidden
field should be made visible.
I would appreciate help knowing what I did wrong. Here is the
pertinent code:
<TD WIDTH=100% ALIGN=LEFT>
<INPUT TYPE="HIDDEN" NAME="Instituti on" VALUE="{Individ uals.CS-
Appl Academic.Instit ution}" SIZE=32 MAXLENGTH=5>
</TD>
<TD width="100%">
<Input type="radio" name="addInstit ution" value="Yes"
onClick="choice Institution(thi s.form)">
<Input type="radio" name="addInstit ution" CHECKED value="No"
onClick="choice Institution(thi s.form)">
</TD>
<script LANGUAGE="JavaS cript">
void choiceInstituti on(theForm) {
if(theForm.addI nstitution[0].checked)
{
document.theFor m.getElementByI D("Institution" ).visibility =
"visible"';
}
}
</script>
When I click the radio button with the value of "Yes", nothing changes
on the screen. I'm wondering if this is because the type of the
element is HIDDEN. How should I change this so that I can get it to
display when I click the yes radio button? Thanks.
Ken
should, I think, be fairly easy.
I have one form.
I have two radio buttons.
I have a text box that is hidden.
If you click the radio button that has the value "Yes", the hidden
field should be made visible.
I would appreciate help knowing what I did wrong. Here is the
pertinent code:
<TD WIDTH=100% ALIGN=LEFT>
<INPUT TYPE="HIDDEN" NAME="Instituti on" VALUE="{Individ uals.CS-
Appl Academic.Instit ution}" SIZE=32 MAXLENGTH=5>
</TD>
<TD width="100%">
<Input type="radio" name="addInstit ution" value="Yes"
onClick="choice Institution(thi s.form)">
<Input type="radio" name="addInstit ution" CHECKED value="No"
onClick="choice Institution(thi s.form)">
</TD>
<script LANGUAGE="JavaS cript">
void choiceInstituti on(theForm) {
if(theForm.addI nstitution[0].checked)
{
document.theFor m.getElementByI D("Institution" ).visibility =
"visible"';
}
}
</script>
When I click the radio button with the value of "Yes", nothing changes
on the screen. I'm wondering if this is because the type of the
element is HIDDEN. How should I change this so that I can get it to
display when I click the yes radio button? Thanks.
Ken
Comment