rtown
08-24-2010, 12:06 PM
Hey guys,
I have a form where the user edits a record. The form consists of a dropdown where the field [status] is changed.
The problem is, the dropdown initial value always just goes to the first value in the list, rather than the actual record value. I have tried the following code but I cant get to work:
<select name="Status">
<option value="Not Started" <% if status = "Not Started" then response.write("selected") end if %>>Not Started</option>
<option value="Bill" <% if status = "Bill" then response.write("selected") end if %>>Bill</option>
<option value="Bob" <% if status = "Bob" then response.write("selected") end if %>>Bob</option>
<option value="Joe" <% if status = "Joe" then response.write("selected") end if %>>Joe</option>
</select>
The status is being passed to this page just fine, as the following write the field status successfully:
<%
status = Recordset("Status")
Response.Write status
%>
So whats the deal... Status is recognized and is returning the correct value... yet it will not work to maintain the dropdown value... so right now, the user editing doesnt realize the dropdown is simply reverting back to the first value, and presses save, effectively erasing the previous status... not good. :(
I have a form where the user edits a record. The form consists of a dropdown where the field [status] is changed.
The problem is, the dropdown initial value always just goes to the first value in the list, rather than the actual record value. I have tried the following code but I cant get to work:
<select name="Status">
<option value="Not Started" <% if status = "Not Started" then response.write("selected") end if %>>Not Started</option>
<option value="Bill" <% if status = "Bill" then response.write("selected") end if %>>Bill</option>
<option value="Bob" <% if status = "Bob" then response.write("selected") end if %>>Bob</option>
<option value="Joe" <% if status = "Joe" then response.write("selected") end if %>>Joe</option>
</select>
The status is being passed to this page just fine, as the following write the field status successfully:
<%
status = Recordset("Status")
Response.Write status
%>
So whats the deal... Status is recognized and is returning the correct value... yet it will not work to maintain the dropdown value... so right now, the user editing doesnt realize the dropdown is simply reverting back to the first value, and presses save, effectively erasing the previous status... not good. :(