Selecting a value for a combobox


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")

Any ideas?
Who is Participating?
Scott Fell, EE MVEConnect With a Mentor Developer & EE ModeratorCommented:
It's going to look more like this

<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>
prositAuthor Commented:
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>
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.