Keep in mind that CF is executed on the server, and JavaScript doesn't get
executed until the page is sent to the browser.  So JavaScript variables
aren't available to CF at run time.  The best way (though there are more
elegant solutions) would be to grab the JavaScript variables, then pass them
(via JavaScript) to the cfm page where the sql will take place.

<script language="JavaScript1.2" type="text/javascript">
h = screen.height;
location.href = "sqlpage.cfm?h=" + h;
</script>


-----Original Message-----
From: vinicius [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 01, 2000 2:30 AM
To: cftalk
Subject: JS CFM & SQL


Hi there, I'm trying to write in a database, a value passed by a JS

like:

<script language="JavaScript1.2" type="text/javascript">
h = screen.height;
</script>

Then I want to put it in SQL statement in a cfquery, how do I do it, I
tried:

<cfquery datasource="dsn">
    INSERT Into table(height)
    VALUES(h)
</cfquery>

don't work.
Then I tried:

<cfset height =<script>document.write(h);</script>

don't work either, what else can I do?
thanks
Vinicius

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to