Results 1 to 3 of 3

Thread: combo box....how do I get the value of the selected item???

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    Hi,

    Im working on php3 with MySQL .....I need to let the user select an item from a drop-down list..

    Ive used the <select> and <option> tags to display att the items.
    how do I get back the item which the user has selected???

    Any help will be greatly appreciated.

    Thanx.

  2. #2
    New Member
    Join Date
    Aug 2000
    Location
    South Africa
    Posts
    13
    here is the a VBScript example

    the formname is "form1"
    <FORM id=form1 name=form1>

    the select box is called "select1"
    <SELECT id=select1 name=select1>


    to get the string selected use the following command.

    myvar = form1.select1.value

    hope it helps
    Stefan SA

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    realised that if I use :

    <select name="mylist">
    <option value="name"> name</option>
    <option value="age"> age</option>
    <option value="address"> address</option>
    </select>

    php3 automatically takes the selected item into a variable ($mylist)

    thanx anyway stefank. :-)

Posting Permissions

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



Click Here to Expand Forum to Full Width