www.webdeveloper.com
Results 1 to 2 of 2

Thread: Where do you specify the value to the server when using <option value=""> tag in HTML

  1. #1
    Join Date
    Apr 2009
    Posts
    1

    Question Where do you specify the value to the server when using <option value=""> tag in HTML

    I've been checking the web for information on this but haven't found any. All the sources I've checked just indicate that the value attribute in the option tag is what is sent to the server when you select an option. They don't tell you where to specify the meaning of that value to the server.... What i mean is say for example you used <a href = "index.html">Home</a>, when you click on Home, the value of href is what is displayed (which is another already coded and existing webpage), if you used <img src = "image.gif" />, it will display an already existing image. But in the option tag, where is the value of the value attribute located, existing or specified. I hope thats explanatory enough. Thanks.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    The option value is sent as a query to the page defined in the form action attribute.
    Code:
    <form action="page.htm" name="form1">
    <select name="qty">
    <option selected value="0">zero</option>
    <option value="1">one</option>
    </select>
    <button type="submit">submit</button>
    </form>
    On submission this document would open: page.htm?qty=0

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles