#!/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??
In reply to ajax in perl cgi by chella2104@gmail.com
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |