Selecting a value for a combobox

Posted on 2012-08-28
Last Modified: 2012-08-28

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?
Question by:prosit
    LVL 52

    Accepted Solution

    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>
    LVL 2

    Author Closing Comment

    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>

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now