LuigiX
10-04-2003, 04:05 PM
Hi
I am connecting a radio button via the following code:
<input type="radio" name="grpPootaType" value="V5" onclick="showhide('fromDepartment'); ">
to a text field in a div tag thus:
<div id=fromDepartment style="display:none">
The showhide function does the following:
function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
}
}
This works fine and dandy the first time, but if I hit the radio button a second time, the text field disappears. I presume any data entered wil still be sent via the form?? Further, if I click another radio button in the group, the text field remains. It should clear and hide.
Can you modify my showhide function to do this?
Your help is appreciated.
Cheers
Luigi
I am connecting a radio button via the following code:
<input type="radio" name="grpPootaType" value="V5" onclick="showhide('fromDepartment'); ">
to a text field in a div tag thus:
<div id=fromDepartment style="display:none">
The showhide function does the following:
function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
}
}
This works fine and dandy the first time, but if I hit the radio button a second time, the text field disappears. I presume any data entered wil still be sent via the form?? Further, if I click another radio button in the group, the text field remains. It should clear and hide.
Can you modify my showhide function to do this?
Your help is appreciated.
Cheers
Luigi