Ben,
Thanks for the link-
I've already got something like that - I guess I can make the query to Mysql
before the Javascript. Looks like they ran into the same problem I did and
they had to insert the "---------------" so that the displayed data could read
properly.
But couldn't I pull the selected data with a param statement?
Check out the example below and let me know if this will work.
print "Please Select your College";
my $sth = $dbh->prepare("select college from list")
$sth->execute;
my @arr=();
while (@arr = $sth->fetchrow_array())
{
($college)=@arr;
$college = $college;
print $query->popup_menu (-name=>'COLLEGE',
-"values"=>['$college',
],
-default=>$defaultcollege);
}
$sth->finish();
## now grab the choice from the drop down menu?
my $choice = $query->param("COLLEGE");
## would I need to add my $query= new CGI;
##and then I could plug $choice into the next select statement:
## second drop down menu
print "<BR>";
print "Please Select the Department</td><td>";
my $sth = $dbh->prepare("select dept from list
where college="$choice" ")
$sth->execute;
my @arr=();
while (@arr = $sth->fetchrow_array())
{
($dept)=@arr;
$dept = $dept;
print $query->popup_menu (-name=>'DEPT',
-"values"=>['$dept',
],
-default=>$defaultdept);
}
benjamin-weiss wrote:
> Doug,
>
> I ran across a site the other day that does something like this. I looked
> at the source, and they're using javascript, but a good part of that script
> can be generated dynamically from MySQL.
>
> The link is:
>
> http://www.csd.toshiba.com/cgi-bin/tais/home.jsp
>
> Then choose the Technical Support link at the top right, then the Tech
> Support Center in the middle. You'll see three list boxes. Have fun!
>
> Ben
> ----------------------------
> BENJAMIN J. WEISS
> 2LT, SC, OKARNG
> 45th Infantry Brigade (SEP)
> Signal Platoon Leader
>