Solved

In ASP and VBScript I have a combo box that I need the value from without leaving the page.

Posted on 2007-03-28
8
208 Views
Last Modified: 2010-08-05
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.
0
Comment
Question by:donaldbean
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 10

Expert Comment

by:Jaax
ID: 18814037
I think the event you should invoke is onChange in javascript. Maybe for VBScript it is On_change
0
 
LVL 22

Expert Comment

by:neeraj523
ID: 18814743
can u post ur code here and will see the issue in it..

0
 

Author Comment

by:donaldbean
ID: 18815294
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>
0
Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

 
LVL 22

Accepted Solution

by:
neeraj523 earned 125 total points
ID: 18815432
Hello

I m not sure if you looking something like this

==========================================================
<html>
<head>
<title>New Page 1</title>
</head>
<script language=JAVASCRIPT>
<!--
function process(frm)
{
      alert(frm.ProductCode.options[frm.ProductCode.selectedIndex].value)
      return false
}
-->
</script>
<body>
<form method="POST" action="" onSubmit="return process(this)">
<input TYPE="hidden" NAME="VTI-GROUP" VALUE="0">
  <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>
</body>
</html>
=====================================================

let me know if u have questions

neeraj523
0
 

Author Comment

by:donaldbean
ID: 18817753
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.
0
 
LVL 22

Expert Comment

by:neeraj523
ID: 18821184

//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
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question