Solved

CfSelect Bind using URL:page.cfm?state={firstselect.value}

Posted on 2009-04-02
2
1,145 Views
Last Modified: 2013-12-20
I am having an issue returning a value for the code below: I get JSON Parsing error

I have the form that is bind to URL - works fine but I get the error on the parse.

All code is below.
<!---Page 1 the form--->
<cfquery name="Recordset1" datasource="mydsn">
SELECT distinct State
FROM zipcodeworld
order by state
</cfquery>
 
<cfform name="form1" action="#CGI.SCRIPT_NAME#">
  <cfselect name="firstselect" query="Recordset1" value="state" display="state"/> <!--- works great =--->
  <cfselect name="secondselect" bind="url:citylookup.cfm?mystate={firstselect.value}" value="city" display="city"/>  <!---   This part does not work --->
</cfform>
 
 
 
<!---Page 2 the URL its binded to:--->
<cfquery name="Recordset2" datasource="mydsn">
SELECT distinct city
FROM zipcodeworld
WHERE state = <cfqueryparam cfsqltype="cf_sql_VARCHAR" value="#url.mystate#">
</cfquery>
 
<cfoutput>
#serializeJSON(Recordset2)#
</cfoutput>
<!---  it needs to return all cities in state selected from bind on form page --->
When I run the code i get a JSOn Parsing error on form page.

Open in new window

0
Comment
Question by:LeadCo
2 Comments
 
LVL 27

Accepted Solution

by:
azadisaryev earned 500 total points
ID: 24057790
do you use Application.cfm?
does it output anything, like site header/footer, or a <DOCTYPE ...> declaration or some javascript?
that all will break the returned json because it will be appended to the response from the url...

Azadi
0
 

Author Closing Comment

by:LeadCo
ID: 31566136
I did have some html in application removed and works great.

Thanks!
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSL sertificate 5 65
Soundcloud.com 4 21
Restore of mysql database from .SQL file - using Coldfusion 5 34
Insert query into temp tables using Coldfusion 3 13
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…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
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…

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