Here is a snippet that I cut and pasted from a program I wrote. I hope it is complete enough to at least give you an idea. I'm sure that there are many other ways to do it. Just be sure that the directory that the perl script is located in is authorized to run cgi programs. The server cgi-bin directory normally has that ability.
Hope this helps.<html> <head> <script language="JavaScript" type="text/javascript"> function CheckKey (form) { var CGI_URL = "http://my.whatever.site/cgi-bin/" // do javascript stuff here form.action = CGI_URL + "idlookup.pl"; form.submit() // executes idlookup.pl on server return true } </script> </head> <body> <form name=identify method=POST action='javascript:return CheckKey(doc +ument.forms[0]) onsubmit="javascript:return CheckKey(document.forms[0])"> <INPUT TYPE="button" NAME="Checkit" VALUE=' Submit ' onclick="javascript:return CheckKey(document.forms[0])"> </form> </body> </html>
In reply to Re: Execute Perl from Javascript
by jlongino
in thread Execute Perl from Javascript
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |