Trouble pre-populating drop down and textarea from MySQL Database
- by Tony
I am able to successfully pre-populate my questions using the following code: First Name: <input type="text" name="first_name" size="30" maxlength="20" value="' . $row[2] . '" /><br />
However, when I try to do the same for a drop down box and a textarea box, nothing is pre-populated from the database, even though there is actual content in the database. This is the code I'm using for the drop down and textarea, respectively:
<?php
echo '
<form action ="edit_contact.php" method="post">
<div class="contactfirstcolumn">
Prefix:
<select name = "prefix" value="' . $row[0] . '" />
<option value="blank">--</option>
<option value="Dr">Dr.</option>
<option value="Mr">Mr.</option>
<option value="Mrs">Mrs.</option>
<option value="Ms">Ms.</option>
</select><br />';
?>
AND
Contact Description:<textarea id = "contactdesc" name="contactdesc" rows="3" cols="50" value="' . $row[20] . '" /></textarea><br /><br />
It's important to note that I am not receiving any errors. The form loads fine, however without the data for the drop down and textarea fields.
Thanks!
Tony