drop down help

P

Paul C

Hi
Is it possible with asp to have an item in a drop down box selected if a dim
called name is the same as one of the select items. ie if john is passed to
a dim called name and john is an item in the dropdown then it is selected
Thanks
Paul M
 
D

David Berry

Sure.

<%
Dim myValue
myValue = "Test"


if myValue = "Test" then%>
<option selected value="<%=myValue%>"><%=myValue%></option>
<%else%>
<option value="Next Value">Next Value</option>
<%
end if
%>
 
P

Paul C

Thanks David
David Berry said:
Sure.

<%
Dim myValue
myValue = "Test"


if myValue = "Test" then%>
<option selected value="<%=myValue%>"><%=myValue%></option>
<%else%>
<option value="Next Value">Next Value</option>
<%
end if
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top