PDA

Click to See Complete Forum and Search --> : combo box....how do I get the value of the selected item???


rammy
Aug 24th, 2000, 01:17 AM
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.

stefank
Aug 24th, 2000, 06:17 AM
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

rammy
Aug 24th, 2000, 11:34 PM
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. :-)