in reply to Re^2: submit to muliple actions
in thread submit to muliple actions

Sure. I'd use Prototype to do this. If I wanted to submit a form with two fields "foo" and "bar" to two scripts, "one.pl" and "two.pl" I'd do:

var params = { foo: $('foo').value, bar: $('bar').value }; new Ajax.Request("one.pl", { parameters: params, onSuccess: handle_one }); new Ajax.Request("two.pl", { parameters: params, onSuccess: handle_two });

Then I'd write "handle_one()" and "handle_two()" to do something with the return values from the scripts. Also, you'll want onFailure and onException handlers. But that's the basic idea.

Reluctant JavascriptMonk,
-sam

Replies are listed 'Best First'.
Re^4: submit to muliple actions
by vit (Friar) on Feb 17, 2008 at 19:01 UTC
    Thanks,
    So it should work with perl/cgi, right?
    Why do you suggest to use Prototype?
      Yeah, it'll work with Perl CGI. It doesn't matter what's on the other end of the line - could be COBOL CGI for all the Javascript cares.

      I suggested Prototype because it's what I use. There are lots of fine alternatives.

      -sam

        I tried to install Prototype and got message ERROR 'Wondow' undefined. Do you know what is that.