Choosing option to select with javascript

Discussion in 'Scripts' started by ancom, Mar 27, 2012.

to remove all ads.
  1. ancom

    ancom New Member

    Messages:
    56
    Hello everyone!
    Could you help me with this:
    I have a form like this:
    <form>
    <select name="choice">
    <option value="first">first</option>
    <option value="second" >second</option>
    <option value="third">third</option>
    </select>
    </form>
    Depending on the link on the other page the user clicks I want to show the same form, but with different option selected.
    E.g. if he/she clicks "first" link, he/she gets
    <form>
    <select name="choice">
    <option value="first" selected="selected">first</option>
    <option value="second" >second</option>
    <option value="third">third</option>
    </select>
    </form>
    Can this be done with javascript only? And how? I am a javascript noob:eek:
     
  2. ancom

    ancom New Member

    Messages:
    56
  3. jumpingspider

    jumpingspider New Member

    Messages:
    252

Share This Page