Link to home
Start Free TrialLog in
Avatar of donaldbean
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.
Avatar of Jaax
Jaax
Flag of India image

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..

Avatar of donaldbean
donaldbean

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_results.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>
ASKER CERTIFIED SOLUTION
Avatar of neeraj523
neeraj523
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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[frm.ProductCode.selectedIndex].value
// you can use valStr varaible anywhere for further processing..
      return false
}

neeraj523