Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 6th, 2004, 05:34 PM
Registered User
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default access listbox in onchange event

I've googled for hours, but cannot find an answer to this problem, i'm
getting on in coding land now so I know its an obvious solution, but can't
figure out the vbscript syntax is?

- I have a listbox, populated (cb_CountryList) on a page startup with a DB.
- I want the onchange event to open a new window (Test_1-resultspage.asp)
based on the index of the selected item value (passed in query string)
- The Onchange event therefore must reference the list box that has not been declared yet
- This doesn't compile. I've also tried full path declaration e.g. this.frmCountryListBox.cb_CountryList.SelectedInde x, and putting the onchange event in the form rather than the list box definition
nothing seems to work

any quick pointers appreciated?
many thanks

<form action="" method="post" name="frmCountryListBox" onchange="window.open('Test_1-resultspage.asp?How=ById&CountryIndex=<%cb_Country List.SelectedIndex%>')" target="pop" >
  <select name="cb_CountryList" id="cb_CountryList" >
While (NOT rs_CountryList.EOF)
    <option value="<%=(rs_CountryList.Fields.Item("Country").V alue)%>"><%=(rs_CountryList.Fields.Item("Country") .Value)%></option>
If (rs_CountryList.CursorType > 0) Then
End If

Similar Threads
Thread Thread Starter Forum Replies Last Post
onChange event mcinar HTML Code Clinic 3 May 24th, 2007 08:46 PM
onChange Event mcinar Javascript 11 May 11th, 2007 09:38 AM
Event:OnChange catchrohith Classic ASP Basics 0 November 3rd, 2006 12:52 AM
submit form on listbox onchange webnitro Javascript How-To 3 December 10th, 2005 08:31 PM
Onchange listbox Varg_88 JSP Basics 1 June 16th, 2004 07:45 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.