donaldbean
asked on
In ASP and VBScript I have a combo box that I need the value from without leaving the page.
In ASP and VBScript I have a combo box that I need the value from without leaving the page. I tried using the On_click but that errors out. Please help.
I think the event you should invoke is onChange in javascript. Maybe for VBScript it is On_change
can u post ur code here and will see the issue in it..
ASKER
Here it is it's very crude as it was done at 2 am. Thanks
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor. Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<script id=clientEventHandlersVBS language=vbscript>
<!--
Sub ProductCode_onclick
strProductCode = Request.Form("ProductCode" )
End Sub
-->
</script>
<body>
<%@ Language = VBSCript %>
<%Dim strProductCode%>
<%On error resume next%>
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" u-file="../_private/form_r esults.csv " s-format="TEXT/CSV" s-label-fields="TRUE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" --><p>
<select size="1" name="ProductCode">
<option selected value="1">a</option>
<option value="2">b</option>
</select><input type="submit" value="Submit" name="B1"></p>
</form>
<%=strProductCode%>
<%strProductCode = Request.Form("ProductCode" )%>
<%=strProductCode%>
</body>
</html>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<script id=clientEventHandlersVBS language=vbscript>
<!--
Sub ProductCode_onclick
strProductCode = Request.Form("ProductCode"
End Sub
-->
</script>
<body>
<%@ Language = VBSCript %>
<%Dim strProductCode%>
<%On error resume next%>
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" u-file="../_private/form_r
<select size="1" name="ProductCode">
<option selected value="1">a</option>
<option value="2">b</option>
</select><input type="submit" value="Submit" name="B1"></p>
</form>
<%=strProductCode%>
<%strProductCode = Request.Form("ProductCode"
<%=strProductCode%>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
neeraj523 thanks for the help I am on my way. Please tell me how I can get the results from the function in to a variable that I can use for some other items I need to display.
//defining variable here will allow you to use this variable through out your page..
var valStr
function process(frm)
{
valStr = frm.ProductCode.options[fr
// you can use valStr varaible anywhere for further processing..
return false
}
neeraj523