Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Select box in CF

Status
Not open for further replies.

PetersWeb

Programmer
Apr 26, 2000
29
AU
I've got an application which shows each employee's area of specialty (some have 2 or 3).<br><br>At present I'm using a Multiple select box which seems to work well when recording the information.&nbsp;&nbsp;When an employee tries to edit their information, only one specialty shows as &quot;SELECTED&quot;.<br><br>I've tried the following code:<br><br>&lt;CFSELECT NAME=&quot;areas&quot; MESSAGE=&quot;Please enter your Practice area&quot; QUERY=&quot;selectArea&quot; VALUE=&quot;PracticeID&quot; DISPLAY=&quot;Area&quot; REQUIRED=&quot;Yes&quot; MULTIPLE&gt;<br>&lt;CFIF&nbsp;&nbsp;ParameterExists(FORM.EditBarrister1) OR ParameterExists(URL.EDITRECORD)&gt;<br>&lt;OPTION VALUE=&quot;#selectArea.PracticeID#&quot;<br>&lt;CFLOOP INDEX=&quot;ID&quot; LIST=&quot;#ListPractices.PracticeID#&quot;&gt;<br>&lt;CFIF #selectArea.PracticeID# IS #ID#&gt;<br>&nbsp;SELECTED<br>&lt;/CFIF&gt;<br>&gt;#selectArea.Area#&lt;/OPTION&gt;<br>&lt;/CFLOOP&gt;<br>&lt;/CFIF&gt;<br>&lt;/CFSELECT&gt;<br><br>This results in a list as follows:<br><br>Family<br>Taxation<br>Criminal<br>Test<br>Legislative<br>Family (SELECTED)<br><br>Aaarrgghh!!! <br><br>Any suggestions would be greatly appreciated.<br> <p>Peter Toby<br><a href=mailto:webmaster@petertoby.com.au>webmaster@petertoby.com.au</a><br><a href= site is under construction but getting better!
 
You could try:<br><FONT FACE=monospace><b><br>&lt;CFSELECT NAME=&quot;areas&quot; MESSAGE=&quot;Please enter your Practice area&quot; QUERY=&quot;selectArea&quot; VALUE=&quot;PracticeID&quot; DISPLAY=&quot;Area&quot; REQUIRED=&quot;Yes&quot; MULTIPLE&gt;<br>&nbsp;&nbsp;&lt;CFIF&nbsp;&nbsp;ParameterExists(FORM.EditBarrister1) OR ParameterExists(URL.EDITRECORD)&gt;<br>&nbsp;&nbsp;&lt;OPTION VALUE=&quot;#selectArea.PracticeID#&quot;&lt;CFIF ListContains(ListPractices.PracticeID, selectArea.PracticeID)&gt; SELECTED&lt;/CFIF&gt;&gt;#selectArea.Area#&lt;/OPTION&gt;<br>&nbsp;&nbsp;&lt;/CFIF&gt;<br>&lt;/CFSELECT&gt;<br></b></font><br>Hope this helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top