SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member josh013's Avatar
    Join Date
    Feb 2002
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    useing radio button to select a dropdown menu

    On my page I have 3 radio buttons:
    "FIRST"
    "AFTER"
    "LAST"

    Beside the "After" radio button I have a dropdown menu:
    "AFTER_LIST"

    What I'm wondering is how to make the "After" radio either get it's value from /or make it link to the "After_List"'s value.

    Also I was wondering how to make the "After_List" values only acessable when the "After" radio is selected.

    Thanks for any help or ideas on this subject.
    JOSH

  2. #2
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what you may want to do is check for "after" button is checked if so then set the value to the value of the text boc next to it.
    Azizur Rahman
    Web Application Developer

  3. #3
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    useing radio button to select a dropdown menu

    Hello azizur_rahman,

    I hope this helps.I wrote the script without caching the objects.
    I hope this is what you need:

    Here is the code:

    <html>
    <head>
    <title>Example</title>
    <script language="JavaScript">
    <!---
    document.myform.choice[0].focus();
    function CheckValue(value)
    {
    if(document.myform.choice[1].checked==true)
    {
    document.myform.choice[1].value=value;
    }
    else
    {
    alert('Please you have to select the AFTER OPTION first!');
    document.myform.choice[0].checked=true;
    document.myform.choice[0].focus();
    }
    }
    //--->
    </script>
    </head>
    <body>
    <div align="center">
    <form name="myform">
    FIRST<input type="radio" name="choice" value="value1" checked>
    AFTER<input type="radio" name="choice" value="value2">
    LAST<input type="radio" name="choice" value="value3">
    &nbsp;AFTER_LIST
    <select name="afterlist" size="1" onfocus="CheckValue(this.value)">
    <option value="A" SELECTED>option1</option>
    <option value="B">option2</option>
    <option value="C">option3</option>
    </select>
    </form>
    </div>
    </body>
    </html>


    Kindest Regards

    Alex

  4. #4
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alex, It was not me who wanted to know, josh013
    was the one who asked for it. thanks for answering it... I'v been really busy these days. I was going to submit similar script... but did not have any time.

    thanks on behalf of josh013
    Azizur Rahman
    Web Application Developer

  5. #5
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    useing radio button to select a dropdown menu

    Hello azizur_rahman,

    I'm sorry about my mistake.Thank you for your kindness.

    Have a nice day.

    Kindest Regards...

    Alex

  6. #6
    SitePoint Member josh013's Avatar
    Join Date
    Feb 2002
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys, been real busy with work. Thats just what I needed to get me over the hump. I appreciate the help!
    JOSH


Bookmarks

Posting Permissions

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