Re: Button calling multiple functions



allanrodkin@xxxxxxxxxxx wrote:

> I am a newbie. I am programming in Perl and dynamically generating
> html. I want to call two functions on the click of a button, one a
> javascript function and also a Perl function.

Perl almost always runs on the server, JavaScript almost always runs on the
client.

So you would /probably/ do something like:

<form action="myPerlScript.pl" onsubmit="someJavaScriptFunction()">
<div>
<input type="submit">
</div>
</form>

OR

You would have your Perl script output something along the lines of:

<script type="text/javascript">
someJavaScriptFunction();
</script>

.... depending on what data needed to be sent to the Perl script and what
order you wished the JavaScript function and Perl subroutine to run in.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
.



Relevant Pages

  • Re: Two Perl programming questions
    ... directory names using Perl. ... I can debug through my Perl script and ... How would Perl create the dynamic HTML that I ... Perl is general purpose programming language. ...
    (comp.lang.perl.misc)
  • Bizarre PerlScript/WSH/UTF-8 problem
    ... I try to put utf8 material into a browser page via a Perl script ... embedded in an HTML page. ... I think I've browsed the complete documentation of AS Perl as far ...
    (comp.lang.perl.misc)
  • Re: Cgi.pm and CSS
    ... * don't produce your HTML via CGI.pm and Perl; ... * then we will write a Perl script to display the Template with the ... This is the whole point of a Templating system. ...
    (comp.lang.perl.misc)
  • Re: Getting started, need some help communicating...
    ... Perl needs to be installed on your server, and you import the CGI module into your Perl script, which sits server-side. ... Simply print the relevant HTML code from your Perl script. ...
    (comp.programming)
  • Re: Quick question about using a table of text input fields within a javascrip function
    ... What we have here is a perl function used in a CGI script to print a ... Javascript function to standard out. ... perl script I can get all of them as an array (the perl CGI package ...
    (comp.lang.javascript)