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 Mike Lewis 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 1

Status
Not open for further replies.

max1x

Programmer
Jan 12, 2005
366
US
I'll try CGI vs Perl to ask :)

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 );
 
eWish

Thank you for the reply.

I've reviewed the examples on the page and none of them are related to dropdown options. I've gotten seme good information from them, but am still not sure how to populate the sec dropdown based on the users choice in the first on the same page.
 
I would like retract my previous statement as I was able to find some similar approaches and was able to figure out what I need to do. So much help in not having to write Javascript for this :)

The only problem I'm having is that the page displays my results in div vs tables (like I want) and above the original stmt vs below it; which I'm trying to figure out how to fix.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top