Hi there, I plan to create a drop down menu for user to choose their race but I know I could now list all the race in the list. So, I think to
create a textfield for them to state their race. But once the textfield is created, the drop down menu seems not working anymore. It shows empty when the users left the textfield empty even they choose their race in the drop down menu.
Here’s the code
<tr>
<td width="166" height="21"><strong style="color: #FFFFFF;"> Race</strong></td>
<td width="12" height="21"><strong style="color: #FFFFFF;">:</strong></td>
<td width="640" height="21">
<strong id="spryselect1">
<label>
<select style="color: #009; font-family: Verdana, Geneva, sans-serif; font-size: 11px;"name="student_race" id="student_race">
<option value="Malay" <?php if (!(strcmp("Malay", $row_student['student_race']))) {echo "selected=\\"selected\\"";} ?>>Malay</option>
<option value="Chinese" <?php if (!(strcmp("Chinese", $row_student['student_race']))) {echo "selected=\\"selected\\"";} ?>>Chinese</option>
<option value="Christian" <?php if (!(strcmp("Christian", $row_student['student_race']))) {echo "selected=\\"selected\\"";} ?>>Indian</option>
<option value="Other" <?php if (!(strcmp("Other", $row_student['student_race']))) {echo "selected=\\"selected\\"";} ?>>Other</option>
</select>
</label>
</strong>
</td>
</tr>
<tr>
<td height="21"> </td>
<td height="21"> </td>
<td height="21">If Other, please state :<strong id="sprytextfield3">
<label>
<input style="color: #009; font-family: Verdana, Geneva, sans-serif; font-size: 11px;" name="student_race" type="text" id="student_race" value="<?php echo $row_student['student_race']; ?>" size="40" maxlength="100" />
</label>
</strong></td>
</tr>
Please advise. Thank you.