Hi,
I have a JavaScript Function that returns a numeric value.
How can I take that value and then use it with my ASP or VBScript Code.
Printable View
Hi,
I have a JavaScript Function that returns a numeric value.
How can I take that value and then use it with my ASP or VBScript Code.
I would use a hidden input box on a form. After submitting the form, ASP can read the value of the form variable and work with it as required
How would you set the hidden value
here is a quick page I put together:
Code:<HTML>
<SCRIPT language=Javascript>
function SubmitIt()
{
// set the value
document.frmMain.txtJSResult.value = "HELLO WORLD!";
// display that the value is set
window.alert(document.frmMain.txtJSResult.value);
// submit the form
document.frmMain.submit();
}
</SCRIPT>
<BODY>
<form name=frmMain method=post>
<input name=txtJSResult type=hidden>
</form>
<Input type=Button name=cmdSubmit value=SUBMIT onclick="SubmitIt();">
</BODY>
</HTML>
Thanks