Solved

Bind expressions cannot be empty.(coldfusion)

Posted on 2009-05-12
2
740 Views
Last Modified: 2013-12-20
Hello experts.
I have a query:
<cfquery name="getmodell" datasource="#request.dsn#">
SELECT Modell
From Artikel
WHERE Mobile_Sub_ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#Url.Mobile_Sub_ID#">
Order by Modell ASC
</cfquery>
<cfset modellist= valuelist(getmodell.Modell,',')>

And a cfinput:
<cfinput  type="text" name="S_Modell" Autosuggest="#modellist#" />

If i don't have any records (recordcount = 0) i have the error Bind expressions cannot be empty.
Any help to solve the problem?
0
Comment
Question by:Panos
2 Comments
 
LVL 27

Accepted Solution

by:
azadisaryev earned 500 total points
ID: 24373697
wrap your <cfinput> in a <cfif> block checking for listlen(modellist), and if list is empty, show a plain text input box (without autosuggest):

<cfif listlen(modellist)>
  <cfinput  type="text" name="S_Modell" Autosuggest="#modellist#" />
<cfelse>
  <cfinput  type="text" name="S_Modell" />
</cfif>

Azadi
0
 
LVL 2

Author Closing Comment

by:Panos
ID: 31580861
Thank you azadi fr yur help
regards
panos
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now