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

Calling vbscript function in ASP

Status
Not open for further replies.

Technos

Programmer
Mar 15, 2002
47
US
Hi All,

I have a vbscript function which is returing value of combobox selection like this.

<script language = &quot;vbscript&quot;>
function GetStrProduct
dim strProduct
strProduct = document.all(&quot;cboProduct&quot;).value
GetStrProduct = strProduct
end function
</script>

now how can I retrieve this value in my ASP

I'm doing this


<div>
<%
dim product
product = GetStrProduct
Response.write(product)
%>
</div>

and its returning blank. Please help. I'm badly stuck.

Wondering how is it possible???

Thanks.
 
This should be posted in the ASP Forum.

First thing to do is make sure you have Option Explicit in your ASP pages, and generally you ought to have it in your client script as well. Then you'd see that you HAVE NO GetStrProduct in your ASP page. You're creating a variable on the fly and it is null.

ASP script can't call a function in client script. There isn't any sort of coupling at all.

Any value developed on the client side needs to be sent back to the server via an HTTP GET or POST, typically a form submit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top