chella2104@gmail.com has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use CGI; use CGI::Ajax; my $cgi = new CGI; my $pjx = new CGI::Ajax( 'exported_func' => \&perl_func ); print $pjx->build_html( $cgi, \&Show_HTML); sub perl_func { my @input = @{$_[0]}; my $output = $input[0] . " is your id"; return( $output ); } sub Show_HTML { my $html= qq{ <HTML> <BODY> <table> <tr> <td>Student ID: </td> <td><input type="text" name="stu_id" id="stu_id" ></td> </tr> <tr> <td>Student Name: </td> <td> <input type="text" name="stu_name" id="stu_name"> </td> </tr> <tr> <td>Address: </td> <td><input type="text" name="addr" id ="addr"> <br></td> </tr> <tr> <td>Department: </td> <td> <select name="dept" id="dept"> <option value="IT">IT</option> <option value="CSE">CSE</option> <option value="ECE">ECE</option> <option value="EEE">EEE</option> </select></td> </tr> <tr> <td><input type="submit" value="Submit" onClick="exported_func +( ['stu_id','stu_name','addr','dept'], ['resultdiv'] ); ></td> </tr> </table> <div id="resultdiv"></div> </BODY> </HTML> }; return $html; } 1;
The above code is not work.
I want output to display in div tag . Anyone can help me??
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ajax in perl cgi
by Anonymous Monk on Mar 25, 2016 at 06:45 UTC | |
by chella2104@gmail.com (Sexton) on Mar 25, 2016 at 06:47 UTC | |
by Anonymous Monk on Mar 25, 2016 at 06:50 UTC | |
by chella2104@gmail.com (Sexton) on Mar 25, 2016 at 06:56 UTC | |
by poj (Abbot) on Mar 25, 2016 at 07:51 UTC | |
by Anonymous Monk on Mar 25, 2016 at 07:20 UTC | |
|