2 Replies Latest reply on Nov 1, 2006 7:04 AM by Newsgroup_User

    Choosing the selected item for updating <select>

    Level 7
      I have a form that has multiple <select> form items. I have an update page
      that allows the user to edit information. I would like the <select> to
      preselect the item that matched the db entry so the user doesn't have to
      reselect it each time.

      The <select> is populated from a database. How can I do this?

      I've done it before using a static <select> options using a <cfif>

      <cfif #GetMyCase.country# EQ #id#>selected="selected"

      <select name="country">
      <cfoutput query="ListCountry">
      <option value="#id#">#country#</option>