What are you trying to show. If you want a literal put your alert results in
quotes.     alert("<cfoutput>#query2.RecordCount#</cfoutput>");

Robert B. Harrison
Director of Interactive Services
Austin & Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be &.

Plug in to our blog: A&W Unplugged
http://www.austin-williams.com/unplugged



-----Original Message-----
From: fun and learning [mailto:funandlrnn...@gmail.com] 
Sent: Wednesday, April 14, 2010 4:13 PM
To: cf-talk
Subject: cfquery within javascript


hi,

I am trying to do the following:

I wrote a cfquery within javascript function as below:

<script language="javascript1.2" type="text/javascript">
<cfquery name="query1 datasource="abc">
  ....
</cfquery>

<cfif query1.recordcount neq "0">
    <cfoutput query = "query1">
       <cfquery name="query2 datasource="abc">
  select * from table1 where name=#query1.name#
       </cfquery>
    </cfoutput>
     alert(<cfoutput>#query2.RecordCount#</cfoutput>);
</cfif>
      

</script>

The alert value is 1 but the debugging section shows 0, and 0 is the correct
value. is there something wrong that I am doing.

If so can you please point out...




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332888
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to