Textbox when radio button clicked

Discussion in 'Javascript' started by Bart Verbeke, Jun 13, 2004.

  1. Bart Verbeke

    Bart Verbeke Guest


    I have a form with 2 radio buttons (ACCEPT/REJECT). When the page is
    initially loaded, no textbox should be visible.

    When a user clicks the REJECT radio button, a textbox should
    automatically appear below the radiobutton where the user can motivate
    why he chose the reject option (which we require).

    When the user clicks the ACCEPT radio button, the textbox should not
    appear because we don't need motivations for accept actions.

    Does someone have a clue if and how I can realize this in JavaScript?

    Bart Verbeke, Jun 13, 2004
    1. Advertisements

  2. Bart Verbeke

    Evertjan. Guest

    Bart Verbeke wrote on 13 jun 2004 in comp.lang.javascript:

    <input type='radio' name='aacrej' value='acc'
    onclick="doen(this)" checked> Accepteren
    <input type='radio' name='aacrej' value='rej'
    onclick="doen(this)"> Rejecteren
    <input id='motief' name='motief'

    <script type='text/javascript'>
    function doen(x){
    Evertjan., Jun 13, 2004
    1. Advertisements

  3. Bart Verbeke

    Bart Verbeke Guest


    Bart Verbeke, Jun 14, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.