goldensunrise
Programmer
- Nov 22, 2000
- 18
Take a look at what I am working on:
HERE'S THE QUESTION:
How do I change what shows up in the second box based on what is chosen in the first box? I've tried some javascript stuff but, have had no luck. Any help would be apreciated.
Here's the Code:
$main="images";
chomp $main;
print start_form({-enctype=>'multipart/form-data', -method=>'POST', -action=>'category_listing2.cgi'});
opendir (MAIN, $main);
@dir =readdir MAIN;
#GENERATES CODE FOR MAIN CATEGORY DROP DOWN LIST BOX
print ('<SELECT name="mainCat">');
for ($i = 0; $i <= $#dir; $i++)
{
if ( $dir[$i] !~ /^\./ )
{
print ('<CENTER><OPTION');
if ( param("mainCat" && param("mainCat" eq $dir[$i])
{
print (' selected');
}
print ('>', $dir[$i], '</OPTION></CENTER>', br);
opendir (SUB, "$main/$dir[$i]"
@sub=readdir SUB;
}
}
print ('</SELECT>');
print (" "
#GENERATES CODE FOR SUB CATEGORY DROP DOWN LIST BOX
print ('<SELECT name="subCat">');
for ($a = 0; $a <= $#sub; $a++)
{
if ( $sub[$a] !~ /^\./)
{
print ('<CENTER><OPTION>', $sub[$a], '</OPTION></CENTER>', br);
}
}
print ('</SELECT>');
print (" "
print (input({-type=>'submit', -value=>'View Pictures'}), br);
print end_form;
HERE'S THE QUESTION:
How do I change what shows up in the second box based on what is chosen in the first box? I've tried some javascript stuff but, have had no luck. Any help would be apreciated.
Here's the Code:
$main="images";
chomp $main;
print start_form({-enctype=>'multipart/form-data', -method=>'POST', -action=>'category_listing2.cgi'});
opendir (MAIN, $main);
@dir =readdir MAIN;
#GENERATES CODE FOR MAIN CATEGORY DROP DOWN LIST BOX
print ('<SELECT name="mainCat">');
for ($i = 0; $i <= $#dir; $i++)
{
if ( $dir[$i] !~ /^\./ )
{
print ('<CENTER><OPTION');
if ( param("mainCat" && param("mainCat" eq $dir[$i])
{
print (' selected');
}
print ('>', $dir[$i], '</OPTION></CENTER>', br);
opendir (SUB, "$main/$dir[$i]"
@sub=readdir SUB;
}
}
print ('</SELECT>');
print (" "
#GENERATES CODE FOR SUB CATEGORY DROP DOWN LIST BOX
print ('<SELECT name="subCat">');
for ($a = 0; $a <= $#sub; $a++)
{
if ( $sub[$a] !~ /^\./)
{
print ('<CENTER><OPTION>', $sub[$a], '</OPTION></CENTER>', br);
}
}
print ('</SELECT>');
print (" "
print (input({-type=>'submit', -value=>'View Pictures'}), br);
print end_form;