form action x2 - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

form action x2

korscottkorscott Posts: 1Member
I have a form that workd great when I post the data to 1 location through the "<form name="free" method="post" action="

I want to get this form to also go to another script simultaneously. How can I get the "action=" to see 2 locations to post to?

I have a validator running through "onSubmit="

Any help would be great!!! I'm not sure where to even start.

Comments

  • SouldrinkerSouldrinker Posts: 143Member
    Hm... this is really tricky - did this some months ago, don't know for certain what was the task I had.

    Just create a frameset with two frames - one is visible, the other is width or height "0", just as you would like it - however, the second frame should be "invisible" to the user.

    Suggestion:

    The form is named "myform"

    The submit button is none, it is a "" with onClick-function: submit_twice();

    The first frame (visible) is caled "visframe", the second one (invisible) is called "invframe"

    ______________________________________________________________________
    Now you create an Array using javascript

    var Locations = new Array();

    Locations[0] = "location1";
    Locations[1] = "location2";

    Here your submit_twice function is:

    document.forms['myform'].action=locations[0];
    document.forms['myform'].target='invframe';
    document.forms['myform'].submit();

    document.forms['myform'].action=locations[1];
    document.forms['myform'].target='visframe';
    document.forms['myform'].submit();

    ______________________________________________________________________
    Now the data is submitted once each frame, so you can handle it twice - using different scripts in both frames.

    Hope this works and helps!


    best regards,

    sebastian mohrenstecher
    executive secretary
    net::allies

    www.net-allies.de
    [email protected]

Sign In or Register to comment.