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
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
205 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
  • 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
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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 …
The viewer will learn how to dynamically set the form action using jQuery.

838 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