getting value from radiobutton

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • R.G. Vervoort

    #1

    getting value from radiobutton

    I would like to make a script wich makes a select visible or not visible
    depending on what radio button is selected.

    If the radiobutton with the value "nieuw" is selected the pulldown is not
    visible and when i select the radiobutton with the value "verwijdere n" the
    pulldown should become visible.

    The code i have makes the pull down visible but does not make it invisible
    after i select another radiobutton.



    This what i have so far:


    <script language="JavaS cript">
    <!--
    function Menue()
    {
    if (document.all.k euze.value == "nieuw")
    {
    document.all.na am_keuze.style. visibility="hid den"
    }
    else
    {
    document.all.na am_keuze.style. visibility="vis ible"
    }
    };

    //-->
    </script>
    </head>

    <body>
    <h1>Specialiste n / zorgverleners</h1>

    <p align="left">
    <input id="keuze" type="radio" name="keuze" value="nieuw"
    onClick="Menue( )">
    Nieuw
    <input id="keuze" type="radio" name="keuze" value="bewerken "
    onClick="Menue( )">
    Bewerken
    <input id="keuze" type="radio" name="keuze" value="verwijde ren"
    onClick="Menue( )">
    Verwijderen<img src="images/spacer.gif" width="100" height="5">
    <select id="naam_keuze " size="1" name="keuze" style="visibili ty:visible">
    <option>roy</option>
    <option>jan</option>
    <option>hans</option>
    <option>piet</option>
    </select>
    </p>





    thanks

    roy


  • Morris

    #2
    Re: getting value from radiobutton


    "R.G. Vervoort" <roy.vervoort@r oyvervoort.nl> a écrit dans le message de
    news:407c1bca$0 $559$e4fe514c@n ews.xs4all.nl.. .[color=blue]
    > I would like to make a script wich makes a select visible or not visible
    > depending on what radio button is selected.
    >
    > If the radiobutton with the value "nieuw" is selected the pulldown is not
    > visible and when i select the radiobutton with the value "verwijdere n" the
    > pulldown should become visible.
    >
    > The code i have makes the pull down visible but does not make it invisible
    > after i select another radiobutton.
    >
    >
    >
    > This what i have so far:
    >
    >
    > <script language="JavaS cript">
    > <!--
    > function Menue()
    > {
    > if (document.all.k euze.value == "nieuw")[/color]

    Try this:
    function Menue(selection )
    {
    if (selection == "nieuw")
    [color=blue]
    > {
    > document.all.na am_keuze.style. visibility="hid den"
    > }
    > else
    > {
    > document.all.na am_keuze.style. visibility="vis ible"
    > }
    > };
    >
    > //-->
    > </script>
    > </head>
    >
    > <body>
    > <h1>Specialiste n / zorgverleners</h1>[/color]

    Change also onClick="Menue( )" to onClick="Menue( this.value)"
    [color=blue]
    >
    > <p align="left">
    > <input id="keuze" type="radio" name="keuze" value="nieuw"
    > onClick="Menue( )">
    > Nieuw
    > <input id="keuze" type="radio" name="keuze" value="bewerken "
    > onClick="Menue( )">
    > Bewerken
    > <input id="keuze" type="radio" name="keuze" value="verwijde ren"
    > onClick="Menue( )">
    > Verwijderen<img src="images/spacer.gif" width="100" height="5">
    > <select id="naam_keuze " size="1" name="keuze"[/color]
    style="visibili ty:visible">[color=blue]
    > <option>roy</option>
    > <option>jan</option>
    > <option>hans</option>
    > <option>piet</option>
    > </select>
    > </p>
    >
    >
    >
    >
    >
    > thanks
    >
    > roy
    >
    >[/color]


    Comment

    Working...