Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript 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 July 2nd, 2004, 07:58 AM
Authorized User
 
Join Date: Apr 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default javascript - multiple selection boxes

Afternoon all,

Im having problems with some multiple dropdownlists on an asp page.
(2nd and 3rd dropdowns are "No Preference" by default)

Im retrieving manufacturer & shortmodel into one array, then shortmodel & longmodel into a second array.

At the moment when changing the selection of dropdownlist1 you get the shortmodels associated with the selected manufacturer in the second box.

I need to now make it so that when a shortmodel is selected the third dropdownlist shows the longmodels associated with that shortmodel.

Im getting 'object doesnt support this property or method' errors on the line where Im calling the 'derivative' function (when choosing a selection from the second menu)

Code:
function derivative(){

rowNo = 1;
document.the_form.derivative.options.length=1;
if (document.the_form.model.selectedIndex!=0)
{
 for (var t=0; t < <%=DCounter%>; t++)
 {
  TheText = derivativeoption    [0];
  if (TheText == document.the_form.model.options[document.the_form.model.selectedIndex].value)
  {
   document.the_form.derivative.options[rowNo]=new Option(derivativeoption    [1],derivativeoption    [1]);
   rowNo ++;

  }
 }
}
else {
 document.the_form.derivative.options[rowNo]=new Option("No Preference","");
}
document.the_form.derivative.options[0].selected=true;

}
The 3 dropdownboxes are name 'manuf', 'model' and 'derivative'

any help much appreciated,

Pete


 
Old July 2nd, 2004, 09:43 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Pete,

Culd you post the code for the whole page please?

Thanks,

Chris






Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Multiple selection DropDown surendran ASP.NET 2.0 Basics 1 September 26th, 2008 07:49 AM
Multiple Selection of Listbox jasminecyriac ASP.NET 2.0 Basics 0 June 22nd, 2006 05:20 AM
regarding combo boxes using html and javascript preethi.c Beginning VB 6 5 March 3rd, 2005 06:36 AM
multiple check boxes to database cincinnaticj7 Classic ASP Databases 2 January 25th, 2005 03:53 PM
Customizing Javascript Message boxes pvasudevan Javascript How-To 1 April 19th, 2004 10:19 AM





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