Skip to content Skip to sidebar Skip to footer

One Form With Multiple Submit Actions

I have an HTML with three links and a form, and three PHP scripts: send1.php, send2.php, send3.php. 1-Send form one

Solution 1:

Solution 2:

Perhaps you could submit 3 times using AJAX ? Here is a simple tutorial using jQuery sending 1 form: http://vimeo.com/1392589.

Do it 3 times :

$("form").on("submit", function() {
  $.ajax(...) // do the ajax call 1
  $.ajax(...) // do the ajax call 2
  $.ajax(...) // do the ajax call 3
})

Solution 3:

You can use Javascript for checking which link was clicked

<aid=""name="signup1"href="#signup"onclick="testFunction(signup1)>1-Send form one</a>
<a id=""  name="signup2"href="#signup"onclick="testFunction(signup2)>2-Send form two</a>
<a id=""  name="signup3"href="#signup"onclick="testFunction(signup3) >3-Send form three</a>
         <div id="signup"><formaction="send_form_x.php"><inputid="clickedLink"type="hidden"><inputid=""name=""type="text"><buttontype="submit">Send</button></form></div> 

//JavaScript            
function testFunction(signup){
document.getElementById("clickedLink").value = signup;
} 

Post a Comment for "One Form With Multiple Submit Actions"