Squid
January 10th, 2005, 02:37 AM
<tr><td> Grades: </td>
<td>
<select name="Grades" >
<option value="1"'.$array[Grades][1].'">GRADE A</option>
<option value="2"'.$array[Grades][2].'">GRADE B</option>
</select>
</td>
The above is a select list. Let's say that we have the value=2 in the database because the user has selected GRADE B, the second option in the list.
Now, user wants to view the data he entered. Still, he would see a select list but this time, in the select list, the GRADE B comes first because it is retrieved from the database as the selected value.
How can I do this? My select list still have GRADE A instead of GRADE B. How can I let my select list comes with GRADE B first?
<td>
<select name="Grades" >
<option value="1"'.$array[Grades][1].'">GRADE A</option>
<option value="2"'.$array[Grades][2].'">GRADE B</option>
</select>
</td>
The above is a select list. Let's say that we have the value=2 in the database because the user has selected GRADE B, the second option in the list.
Now, user wants to view the data he entered. Still, he would see a select list but this time, in the select list, the GRADE B comes first because it is retrieved from the database as the selected value.
How can I do this? My select list still have GRADE A instead of GRADE B. How can I let my select list comes with GRADE B first?