|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
does anyone know what could be causing my pulldown menu to revert back to previous menu item even after i click on new item on top? For example: Immagine the following are PULLDOWN items. Lets say the following pulldown menu is current at Menu 3. PULLDOWNMENU Menu 1 Menu 2 Menu 3 <--- Menu 4 Menu 5 When I select Menu 1, the -onclick is able to recognize that I have selected Menu1, but the Pulldown menu itself reverts back to Menu 3 instead of staying at Menu 1. The same goes for other items that are ABOVE Menu 3. PULLDOWNMENU Menu 1 Menu 2 <-- this was selected and variables passed, but Menu 3 <--- pulldown menu still points to this item Menu 4 Menu 5 But strangely, this doesn't happen for items that are below Menu 3) PULLDOWNMENU Menu 1 Menu 2 Menu 3 Menu 4 <--- if items below previous item selected, NO problem occurs. Menu 5 What could be happening here? Pleaes help. I'm using javascript onclick withina Perl CGI so that pulldown menu's are created dynamically on the fly.. in the following manner. Where I previously define pull down items using a hash. For example: Code:
$pulldown{ftype} = [freq1,freq2,freq3];
$pulldown{obssrc} = [source1, source2,source3];
$pulldown{obssrc2} = [source1, source2,source3];
$pulldown{datatype} = [ascii, binary, image];
sub createpulldown {
print "<table><tr>";
$tablex = 0; $tabley = 0;
foreach $key (sort keys %pulldown){
$tablex++;
if ($tablex > 5) { $tablex = 0; print "</td></tr><tr><td>"; }
else { print "<td>"; }
my @array = @{$pulldown{$key}}; my $default = ${$key};
print "\n<font face=verdana size=-2>$key:\n";
if ($key eq "ftype" || $key eq "obssrc" || $key eq "obssrc2" || $key eq "obssrc3") {
print $q->br, $q->scrolling_list
( -name=>$key, -values=>[@array],
-defaults=>$default,-size=>1,
# -onchange=>'OnChange(this.form.select1);',
# -onchange=>"window.location=('xycoords.cgi?s=&showlast='+this.options[this.selectedIndex].value)"
-onchange=>"window.location=('?&$key='+this.options[this.selectedIndex].value+'$cgistring')"
), $q->p;
} else { print $q->br, $q->scrolling_list
( -name=>$key, -values=>[@array],
-defaults=>$default,-size=>1,
), $q->p;
} #if $key
print "</font></td>";
} #for each
print "</tr></table>";
return 0;
} #sub create pulldown
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > drunken pulldown menu!! please help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|