Current location: Hot Scripts Forums » General Web Coding » JavaScript » Multiple dropdown plus link problem


Multiple dropdown plus link problem

Reply
  #1 (permalink)  
Old 11-17-03, 05:22 PM
bastiaan bastiaan is offline
New Member
 
Join Date: Nov 2003
Location: Almere
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question Multiple dropdown plus link problem

Hi,

For my main index I need the following: Multiple dropdown boxes, which are also dynamic and will after the last selection automatically direct you to the requested page. So far I have this:

--

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var arrItems1 = new Array();
var arrItemsGrp1 = new Array();

arrItems1[3] = "English";
arrItemsGrp1[3] = 1;
arrItems1[4] = "Dutch";
arrItemsGrp1[4] = 1;
arrItems1[5] = "Help";
arrItemsGrp1[5] = 1;

arrItems1[6] = "English";
arrItemsGrp1[6] = 2;
arrItems1[7] = "Dutch";
arrItemsGrp1[7] = 2;
arrItems1[8] = "Help";
arrItemsGrp1[8] = 2;

arrItems1[0] = "DutchBird VA";
arrItemsGrp1[0] = 3;

function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
if (control.name == "firstChoice") {
}
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[SELECT]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// End -->
</script>

</HEAD>

<BODY>

<form name=myChoices>
<table align="center">
<tr>
<td>
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this, myChoices.secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>IBERWORLD VA</option>
<option value=2>Regional</option>
<option value=3>Partners</option>
</SELECT>
</TD><TD>
<SELECT id=secondChoice name=secondChoice>
</select></TD>
</TR>
</TABLE>
</form>

--

Unfortunatly I don't know how I should make the rest I hope that someone is able to help me out with this..

With kind regards,
Bastiaan Klene.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
random link problem doogi PHP 18 03-04-09 02:00 AM
Different type of link counter mdhall Script Requests 2 10-10-03 02:19 PM
Make a query that makes a field a link to the entire row mdhall PHP 8 10-09-03 07:18 PM
Mail Script sending multiple times when Table has a lot of data dsumpter PHP 12 07-16-03 06:17 PM


All times are GMT -5. The time now is 09:20 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.