Skip to main content
December 12, 2006
Answered

Email form with drop-down selection

  • December 12, 2006
  • 2 replies
  • 380 views
I have an email form where the recipients are chosen from combinations of drop-down boxes. The email form works just fine, unless the user chooses more than one item from any of the drop-downs (by using the CTRL key).

This is the form: http://edcollege.ucf.edu/clexp/admin/email/emailbyinternshiptest.cfm

And here is the query I am using:

<cfquery name="q_GetInternship" datasource="#DSN#">

select * from Applications

where

<cfif Len(form.Int_ID)>
Int_type = <cfqueryparam value="#form.Int_ID#">
AND
</cfif>


<cfif Len(form.Major)>
Major = <cfqueryparam value="#form.major#">
AND
</cfif>

<cfif Len(form.county)>
county = <cfqueryparam value="#form.county#">
AND
</cfif>

1 = 1

</cfquery>

Anyone has an idea of how I can fix this problem? Thank you in advance!
This topic has been closed for replies.
Correct answer
What version of CF are you using?

The attached code will work with the recent ones...

2 replies

Correct answer
December 14, 2006
What version of CF are you using?

The attached code will work with the recent ones...

December 14, 2006
It works!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Thank you SO MUCH!

Simone
Inspiring
December 12, 2006
If someone selects 2 items, the form variable will contain a comma and that makes it a list. Cold Fusion has lots of list functions you can use. How you use them depends on what you want to do if they give you a muliple selection.