Solved

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

Posted on 2009-04-02
2
1,152 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

Question has a verified solution.

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

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

690 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