View Complete Thread | FoxWeb Forum Home
Date:    Msg ID:   
From:    Thread:   
FoxWeb code in an FWX script is executed on the server before the resulting output is sent to the browser.  JavaScript code on the other hand, is executed on the browser, after output is returned by FoxWeb.
You can set JavaScript variables to be equal to VFP variables as follows:
M.VFP_Var = "Some Value"
<script language="javascript">
JS_Var = '<%=M.VFP_Var%>';
The resulting code that would be sent to the browser in this case would be:
<script language="javascript">
JS_Var = 'Some Value';
If on the other hand you want to send JavaScript variables back to FoxWeb, you will need to somehow make a trip to the Web server.  In the following example, the value entered by the user on the browser is sent to FoxWeb as part of the query string:
<script language="javascript">
var theResponse = window.prompt("Please enter your name","");
window.location.href = '' + theResponse;
No need for content

FoxWeb Support Team email

Sent by Michael Pena on 01/09/2003 07:09:09 PM:
How do we extract a value from a JavaScript variable to Foxweb variable
on the same page without using POST or GET?
My example would be if possible :
<script language="JavaScript">
mTEXT1 = "hello"
However as we know an error would occur.
Can you give me a way to do this?
Thanks again.