Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass value from sub to another sub utilizing AJAX

Status
Not open for further replies.

max1x

Programmer
Joined
Jan 12, 2005
Messages
366
Location
US
I'm not sure if question is supposed for this forum or CGI or Ajax General Discussion, but I'll ask here & if advised will go there as well.

Basically, I'm trying to get the data in the 2nd dropdown to be based on what the user choose in the first. I did not have access to AJAX before, but now it's available.

Code:
use CGI;
use CGI::Ajax;

 my $cgi = new CGI;
 my $pjx = new CGI::Ajax( 'exported_func' => \&firstSub );

  print $pjx->build_html( $cgi, \&Show_HTML);

sub firstSub {
 my $input = shift;
      my $output = do some stuff;
      &secSub($output); --> this is not working; which will populate the data in 2nd option & then I can do the same for 3rd & 4th drop downs.
    return( $output );
  }

Below is generic from the module documentation

Code:
sub Show_HTML {
$html<<EOF
<html>
<body>
 <table>
   <select name=....>
    </select>
EOF
return $html;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top