Results 1 to 3 of 3

Thread: {Resolved}Radiobutton

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    369

    {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.
    Last edited by dbelley_office; Dec 22nd, 2005 at 10:23 AM.

  2. #2
    Lively Member johnrswanton's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    84

    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>
    ***********
    "why do things that are suspose to bad for us taste so good, whats ur addiction"
    Kanye West
    **********

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Radiobutton

    Make sure the textbox has an id attribute, and then you can use

    document.getElementById('txtboxid').value='';

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width