aspx_professional thread: Assigning the value of a javascript variable to a vbscript variable
How do I assign the value of a javascript variable to a vbscript variable.
For example:
<SCRIPT LANGUAGE="JavaScript">
function display(thisValue,make)
{
var selvalue;
var noption;
noption = 0;
selvalue = document.forms[0].cpccoffice.options[document.forms
[0].cpccoffice.selectedIndex].value;
document.forms[0].cpccCostcenter.length = 0;
alert (selvalue);
alert ( document.forms[0].cpccCostcenter.length);
<%
dim conn,sql,rst,myconn,stroffice
stroffice =selvalue 'I want the variable (stroffice to be equal to the
value of selvalue.
sql = "Select costcenter from dbo.view_OfficeCostCtrName WHERE
office=" & stroffice
%>
alert("<%=stroffice%>");
}
</SCRIPT>