-
{Resolved}Radiobutton
Hi,
On my ASP form I have:
5 options (radio)
- Summer
- Winter
- Fall
- Spring
- None
I have 1 input box (txtActivities)
When the user picks "None", I want in javascript to clear txtActivities.
How do I do that?
I try many event of the "None" radio but nothing works.
Thanks.
EDIT: when doing " onClick= "javascript: this.txtActivities.value = '';"
I get the error saying this.txtActivities as null value or objet does not exist.
But it exists.
EDIT:
The problem was " this " for the form was not good in the event of the radio button. I had to use the real form name " javascript: formSeason.txtActivities.value = '';" and it works.
Thanks for your help.
-
Re: Radiobutton
Try This
<FORM NAME="Form1">
<INPUT NAME="Text1" TYPE="TEXT" value="i clear when none is pressed"><br>
None<INPUT NAME="None" TYPE="radio" onclick="document.Form1.Text1.value=''"><br>
</FORM>
-
Re: Radiobutton
Make sure the textbox has an id attribute, and then you can use
document.getElementById('txtboxid').value='';