Skip to main content
Known Participant
March 15, 2012
Question

get this value from structure

  • March 15, 2012
  • 1 reply
  • 782 views

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#</option>

</select>

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

This topic has been closed for replies.

1 reply

Inspiring
March 16, 2012

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.