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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing server side variable to client side function

Status
Not open for further replies.

princessk1

Programmer
Feb 28, 2002
74
CA
I am trying to pass 2 variables from my server side code to a client side function. I can pass one with no problem but can't seem to get the syntax to pass 2. This is part of my code.

<SCRIPT LANGUAGE = VBScript>
Function Calculate (ctgy,num)
msgbox(ctgy)
msgbox(num)
End Function

<form name= &quot;Percents&quot; method=&quot;post&quot; action=&quot;SaveInfo.asp&quot; >
<% ctgy = &quot;General&quot; %>
<td align = right><input type = &quot;text&quot; align=right name = &quot;general<% =n%>&quot; size=4 value=<% =actualpercent %> onchange=Calculate(&quot;<% =ctgy %>&quot;)></td>

This passes the the value of ctgy (general) to the function.

When I try to add a second parameter, it causes an error on the page.

<form name= &quot;Percents&quot; method=&quot;post&quot; action=&quot;SaveInfo.asp&quot; >
<% ctgy = &quot;General&quot; %>
<% num = 5 %>
<td align = right><input type = &quot;text&quot; align=right name = &quot;general<% =n%>&quot; size=4 value=<% =actualpercent %> onchange=Calculate(&quot;<% =ctgy %>&quot;, <% =num %>)></td>
Any ideas
 
Okay, dumb mistake. I was just missing a closing tag after the parameters! Thanks anyways.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top