Link to home
Start Free TrialLog in
Avatar of prosit
prositFlag for United States of America

asked on

Selecting a value for a combobox

Hi,

I am trying to select the vaue of a combobox based on what's in the database, but it does not select it:

<select name="MemberType" id="MemberType" value = "
<%
      if ElAp = "AP" then response.write("Appointed")
      if ElAp = "EL" then response.write("Elected")
%>">
  <option>Appointed</option>
  <option>Elected</option>
  <option>Coach</option>
</select>

Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of prosit

ASKER

Here's the correct syntax, but thanks, got me all fixed!!!

<select name="MemberType" id="MemberType">
<option <%if ElAp="AP" then response.write("selected") end if %>>Appointed</option>
<option <%if ElAp="EL" then response.write("selected") end if %>>Elected</option>
<option <%if ElAp="CO" then response.write("selected") end if %>>Coach</option>
</select>