1 Reply Latest reply on Apr 24, 2007 7:31 AM by lan99

    Dynamic selected drop down menu

    Exmachin4
      We have a drop down menu that users use to select their industry.
      The issue comes when they go to edit their industry it defaults to the first one in the list and not the one they selected originally.
      Hope this makes since, can any one help me?
        • 1. Re: Dynamic selected drop down menu
          lan99 Level 1
          You would first need to read that users 'industry' field from the database, then do something like

          // get users industry and assign it to originalIndustryId

          <select>
          <cfoutput>
          <cfloop query="industries">
          <option value="#id#"<cfif id eq originalIndustryId> selected</cfif>>#name#</option>
          </cfloop>
          </cfoutput>
          </select>