View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
FoxWeb scripts run on the server, while JavaScript code runs on the browser.  To set a JavaScript variable from FoxWeb code, you will need to create your JavaScript code dynamically at run time.  The following example populates the MyFoxWebVar variable with the submitted value of the FirstName field and then populates the MyJavaScriptVar variable with the same value:

<%
MyFoxWebVar = Request.Form("FirstName")
%>
<html>
<head>
<script type="text/javascript">
var MyJavaScriptVar = '<%=MyFoxWebVar%>';
</script>
</head>
... more HTML

Assuming that the FirstName field was populated with "Francisco", the output that is sent to the browser is:

<html>
<head>
<script type="text/javascript">
var MyJavaScriptVar = 'Francisco';
</script>
</head>
... more HTML
FoxWeb Support Team
support@foxweb.com email
Sent by Francisco Lippke on 01/02/2008 02:49:09 PM:
How I can do? pass foxpro var to javascript var