Is there a way to send data from diffrent forms at the same time with only 1 submit button?

If you're using jQuery First, give your forms and submit button some IDs (I used #form1, #form2, and #submit). Then Edit: Here's a non-AJAX solution that takes advantage of the fact that the forms post to the same URL When the submit button is clicked, move/append the text input $(inputname=baslik) to the second form and then submit it. This solution doesn't need the jQuery Form plugin and doesn't use AJAX: $("#form2").

Submit(function() { $(inputname=baslik). AppendTo($(this)); }) Original, AJAX solution: If you want AJAX, you can use the jQuery Form Plugin $(document). Ready(function() { $('#form1, #form2').

AjaxForm(function() { // optionally do stuff here after forms submitted }); $('#submit'). Click(function() { $('#form1, #form2').ajaxSubmit(); return false; }); }) You can't use jQuery's $(form).serialize() because it does not work on file fields. This solution also assumes you want to use AJAX.

If you're using jQuery... First, give your forms and submit button some IDs (I used #form1, #form2, and #submit). Then... Edit: Here's a non-AJAX solution that takes advantage of the fact that the forms post to the same URL. When the submit button is clicked, move/append the text input $(inputname=baslik) to the second form and then submit it.

This solution doesn't need the jQuery Form plugin and doesn't use AJAX: $("#form2"). Submit(function() { $(inputname=baslik). AppendTo($(this)); }); Original, AJAX solution: If you want AJAX, you can use the jQuery Form Plugin.

$(document). Ready(function() { $('#form1, #form2'). AjaxForm(function() { // optionally do stuff here after forms submitted }); $('#submit').

Click(function() { $('#form1, #form2').ajaxSubmit(); return false; }); }); You can't use jQuery's $(form).serialize() because it does not work on file fields. This solution also assumes you want to use AJAX.

Thanks alot mate – Danny Togaer Jul 28 at 10:41.

One option would be forcing javascript being used: launch a javascript handler that collects the values, submits a ajax request, or even writes a form and submits it. Jquery can easily be used to to loop through all form values. So something like: $("#first_form").

Submit(function() { //collect all values here first_form_data = $("#first_form").serialize(); second_form_data = $("#second_form").serialize(); $. Ajax({ url: .., data: first_form_data + "&" + second_form_data, success: function(data) { } } //let’s not submit the form return false; }.

Yes. Remove the input that submits, and add a link outside every form with the javascript that submits all: (also add an ID to everyform, so you can call them via this javascript) function submitAll(){ document. Forms"IDform1".submit(); document.

Forms"IDform2".submit(); } EDIT: this doesn't work, the only way is via AJAX, please check @Phil's answer!

Thanks alot mate so I need to look into javascript at first thanks mate have a nice day. – Danny Togaer Jul 28 at 9:57 1 Are both submits handled in the same request to the server? – Nobody Jul 28 at 10:03 @jackJoe Does it really work?

What is the URL in the browser after submition of those forms? The URL of the second form? – Karolis Jul 28 at 10:04 2 This method doesn't work because only the first form will be submitted (since they're both POSTing to the same URL).

If they posted to different URLs, only the second one would be submitted. – Phil Jul 28 at 10:06 @Karolis you're right, I forgot about that "tiny" detail, I focused on the how, shame on me! I suppose the only way will be via an AJAX solution.

– jackJoe Jul 28 at 10:08.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions