Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript syntax with asp variables Depsert....

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi I need to pass through url the value of an input (text field) with javascript.Can you show me how the syntax is?
px monthF='+monthF.options[monthF.selectedIndex].value+'&yearF='+yearF.options[yearF.selectedIndex].value+'&pExpNumber='&pExpNumber1'.value">the problem appears in pExpNumber variable (asp variable)
thanks
 
The key to remember is that Javascript is interpreted by the web browser, not the web server, so you need to include the values of your ASP variables in your script for the web browser.

You can set a javascript variable to be the .ASP variable's value, or just put the value into your javascript expression.

If you want to put the ASP value into a javascript value, do the following:

var strVar = '<%=ASP_String%>';
var intVar = <%=ASP_Number%>;

If you want to simply include it in a calculation:
var calc1 = (1 + <%=ASP_Number%> * .50);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top