2 different actions in one form

Results 1 to 2 of 2

Thread: 2 different actions in one form

  1. #1
    Join Date
    Dec 1969

    Default 2 different actions in one form

    Is there a way to have 2 buttons in the same form submit to 2 different page, usingthe same data in that form?

  2. #2
    peterjl@austec.net.au Guest

    Default RE: 2 different actions in one form

    Firstly each form field can only be contained in one form. A form can only have one action. so theoretically you can only send its contents to one server script.<BR><BR>However you could add some Javascript to the onsubmit attribute of your form, so that it could decide to send the submission to alternate addresses depending on the value of one or more field.<BR><BR>If you have two submit buttons on the same form, both with the same name, but different values, then the value of the submit button which is clicked, is the value that gets assigned to that variable. <BR><BR>So in the onsubmit handler, you could redirect the out put to what ever destination you like.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts