Skip navigation
Currently Being Moderated

get this value from structure

Mar 15, 2012 8:30 AM

Tags: #coldfusion

HI i want to preselect my multiselect box from the structure that i am getting

 

CATEGORYone,two

 

above is the sturucte key and values(one,two)

 

 

<select name="CATEGORY" multiple="multiple">

<option value="#getmyvalue.Value#" <cfif StructKeyExists(attributes,"CATEGORY")><cfif #attributes["CATEGORY"]# eq "#getmyvalue.Value#">selected</cfif></cfif>>#getmyvalue.Value#</optio n>

</select>

 

 

what i want is to pre select those two values if that above struct value exists.

 
Replies
  • Currently Being Moderated
    Mar 16, 2012 9:28 AM   in reply to cfnew

    Looks more complicated than it needs to be.  Is this a custom tag?  If not, from where is the attributes scope coming? 

     

    Also, is that all the code associated with the select?  I ask because it only has one option in which case, why bother having a visible form field at all.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points