Link to home
Start Free TrialLog in
Avatar of tpiccirillo
tpiccirillo

asked on

Not selecting value from drop down list

I have created a drop down list that displays values from mysql database.  The values are displayed but when a value is selected it no value is present.  Using html form.  Here is the drop down code:

echo "<select name=location value=''>Location</option>";
// printing the list box select command

while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[id]>$nt[location]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box


When I output Location in program that is called by form it is empty.
Avatar of Robin Uijt
Robin Uijt
Flag of Netherlands image

How does the html output look like?

Try surrounding the $nt[id] by (double) quotes.
ASKER CERTIFIED SOLUTION
Avatar of quincydude
quincydude
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tpiccirillo
tpiccirillo

ASKER

Out put program is working okay for other fields.  Just nothing in this field that is dynamically created.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial