Solved

Bind expressions cannot be empty.(coldfusion)

Posted on 2009-05-12
2
732 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
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…

747 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

11 Experts available now in Live!

Get 1:1 Help Now