my @var = ("a","b","c"); my @value = (); print $co->header; print $co->start_html(); print $co->h4 ("Variable"); print $co->popup_menu( -name => 'var', -id => 'var', -values => ['Var',@var], -default => 'Var', -onchange => "selectedVarFns()" ); print $co->popup_menu( -name => 'value', -id => 'value', -values => [@value], ); # $selected_var shall contain the value selected from 'var' popup_menu + and call selectedVarFn() below when value of popup_menu 'var' change +s. # @Value contains all the values corresponding to the popup_menu varia +ble as defined in the selectedVarFn(). # Everytime I change the value of var popup_menu, selected value shall + be reflected in $selected_var and corresponding to that value, value + in popup_menu 'value' should be updated. #Please update the above program to reflect the requirements. sub selectedVarfn { open (FILE , "../file.txt"); my $count = 0; foreach $Line (<FILE>) { if ($Line =~ /$selected_var/) { $value[$count] = $Line; $count++; } } close (FILE); }
In reply to popup menu by tarunkhanna
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |