Assigning a value to Hidden Type.

Discussion in 'HTML & Website Design' started by thanawala84, Oct 13, 2007.

  1. #1
    Hi, I am a beginner here.

    I was not knowing how to assign the value of a Dropdown menu to a Hidden type variable.

    Code:
    ------------------------------------------------------------------------------------
    <form name=form1 onsubmit="test()">

    <select name=car>
    <option value ="volvo">Volvo</option>
    <option value ="saab">Saab</option>
    <option value ="opel">Opel</option>
    <option value ="audi">Audi</option>
    </select>

    <input type=hidden name=hidden_car value="**********">

    <INPUT TYPE=SUBMIT VALUE=ENTER>

    --------------------------------------------------------------------------------------

    now, i want the hidden variable 'hidden_car" TO have the value that is selected from the dropdown menu before the SUBMIT button is hit.
    in the above example, im not sure what shud be entered in place of ******** for the hidden variable.


    Any help is appreciated.

    Thank You
     
    thanawala84, Oct 13, 2007 IP
  2. papa_face

    papa_face Notable Member

    Messages:
    2,237
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    285
    #2
    Why would you want this?
    The value of the hidden field would be exactly the same as the drop down fields...
     
    papa_face, Oct 13, 2007 IP
  3. rayqsl

    rayqsl Active Member

    Messages:
    91
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    53
    #3
    I agree - the variable called "car" would have the chosen value
     
    rayqsl, Oct 13, 2007 IP
  4. thanawala84

    thanawala84 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    But Still, what be assignemt to the hidden type variable. I have implemented a logic which needs something like that.

    Thanks
     
    thanawala84, Oct 13, 2007 IP
  5. papa_face

    papa_face Notable Member

    Messages:
    2,237
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    285
    #5
    Thats a laughable phrase because doing something like this is completely illogical.
    If you really want to do it you need Javascript.
     
    papa_face, Oct 13, 2007 IP