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
204 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

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…
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

809 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