Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using Combo Box selection in query

New Here ,
Sep 15, 2009 Sep 15, 2009
Greetings!

Check this out...

<cfoutput>
<form name="myForm" id="myForm" method="post">
<SELECT NAME="pickMe">
<cfloop query="marksTest">
<OPTION value="#marksTest.EXPLOIT#">#UCase(marksTest.EXPLOIT)#</OPTION>
</cfloop>
</SELECT>
</form>
</cfoutput>

<cfif isDefined("form.pickMe")>

<cfquery name="marksTest" dbType="query">
   SELECT *
   FROM myquery
</cfquery>

<cfdump var="#marksTest#">

</cfif>

What I am trying to accomplish is that when the user makes a choice from the combo box it is used to perform a query. Am I on the right track here? Any tips or suggestions will be greatly appreciated. Thanks!
648
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 15, 2009 Sep 15, 2009
LATEST

If you are trying to assign the query result to any textbox or anyother field while making a combobox selection, you can just try this..

Assign the query result to be populated to the combobox value field using a pipe symbol

<option  value="OriginalValue|#marksTest.column#>Texttodisplay</option>

On the onchange of combobox, you can call a js function, split to get the second portion of the value of combobox and assign it to whicever field required.

This will simulate assigning the query result on combo selection

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources