Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can i access cf variable with jscript ?

can i access cf variable with jscript ?

by  iza  Posted    (Edited  )
definitly YES

var how_many_rows = <cfoutput>#my_query.recordcount#</cfoutput>
does work

document.all.form_name.textbox1.value in your jscript part is read the same as #form.textbox1#

you can even use that to build dynamic jscript code
function foo(){
<cfif isDefined("the_name")>
... some code1 ...
<cfelse>
... some code 2 ...
</cfif>
}

view-source:your_file.cfm will show

if name is defined
function foo(){
... some code1 ...
}


but you can't use jscript values in cf code - except if you write a cf tag : cf is SERVER side whereas jscript is CLIENT side
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top