on 2/3/01 1:17 AM, Michael Gribbin at [EMAIL PROTECTED] wrote:
> How do I get variables generated by JavaScript to be recognized by
> ColdFusion? I would like to do different things based on JavaScript results.
> When ever I try to put a JavaScript variable into a CFSET or CFIF I get an
> error that says "ColdFusion was unable to determine the value of the
> parameter".
I had the same question and did a search on the allaire forum. Basically you
can't do it directly. Here are 2 methods suggested at the forum
Send value from JavaScript to Cold Fusion
<!--- PAGE1.CFM --->
<HTML>
<BODY>
<Form action="page2.cfm" method="post">
<SCRIPT LANGUAGE="Javascript">
<!--
var now = new Date();
var hour = now.getHours();
var min = now.getMinutes();
document.writeln("<INPUT TYPE = 'HIDDEN' NAME = 'JAVASCRIPT' VALUE 'YES'>");
document.writeln("<A
HREF='http://www.allaire.com?time="+hour+min+"'>LINK</A>");
//-->
</SCRIPT>
<BR>
<BR>
<INPUT TYPE="SUBMIT" VALUE="SUBMIT" NAME="SUBMIT">
</Form>
</BODY>
</HTML>
------------------------------------------------------------------------
* read the value of Javascript on page2.cfm
<!--- PAGE2.CFM --->
<HTML>
<BODY>
<cfif #ParameterExists(FORM.JAVASCRIPT)#>
� � Got JavaScript? � #FORM.JAVASCRIPT#
</cfif >
<cfif #ParameterExists(URL.time)#>
Got time? #URL.time#
</cfif >
</BODY>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists