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
203 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

896 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now