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

No, I don't. Could you give me a hint or a simple example to start with.

Replies are listed 'Best First'.
Re^3: submit to muliple actions
by samtregar (Abbot) on Feb 17, 2008 at 18:48 UTC
    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

      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