How to send multiple forms with one submit button?

There is a form:

<form type="POST" class="obrabotchik">
<input type="text" required id="fio" name="fio">
<input type="text" required id="vozrast" name="vozrast">
<input type="text" required id="text" name="text">
<input type="submit" value="Send"> 

<input type="text" required id="fio" name="fio">
<input type="text" required id="vozrast" name="vozrast">
<input type="text" required id="text" name="text">
<input type="submit" value="Send"> 

<input type="text" required id="fio" name="fio">
<input type="text" required id="vozrast" name="vozrast">
<input type="text" required id="text" name="text">
<input type="submit" value="Send"> 
</form>


works on AJAX submit and sends each form without problems completely... That's only 3 button submit is not beautiful and comfortable for user... is it possible to hide the submit button click (for example, via display:none) from the user and leaving just one, which when clicked, pressed all the buttons at a time?

PS: Write another handler is not an option, as the system is connected to another and you can not break. Need to find a way around the above problem.
June 14th 19 at 20:46
3 answers
June 14th 19 at 20:48
What a joke three identical shapes? Name them differently and send in one request, like fio_3, fio_2, and the principle that better variables transliteration of the English words
Impossible. The handler needs to consider these names and assign each submitted the form your ID.
Yes it is, I for example, so-called, of course I have all the English named and more clear))) - brenna53 commented on June 14th 19 at 20:51
I have a code clear, but You to throw off the bad code.
It is a failure... - sonia20 commented on June 14th 19 at 20:54
you will find fault with the transliteration in the titles? seriously? the experts :D - brenna53 commented on June 14th 19 at 20:57
and here? how to understand what is supposed to happen? if anything id should be one at all ,and there are 3 identical, it is unclear how something works but we need to understand - Elza.Altenwerth commented on June 14th 19 at 21:00
, can't answer correctly, or don't understand the question - pass by! what breed discussion as agroscience? Wrote as I could. Who can, he will understand and answer. - brenna53 commented on June 14th 19 at 21:03
Merely pointed out the complete absurdity of Your post and Your stupidity...
And You need also unclear. Well, create 4 button. On click it will request 1, 2 and 3. Then You have the problem? Or You not to query? Create your unique data-attribute to each field. To him for making the request.

ps hmm.... You will be hard. - sonia20 commented on June 14th 19 at 21:06
and here's no need to be rude.
Learn how to formulate questions that all could understand.
And if You have other code working, how can we help? Read the tea leaves?
Post a real code. - Dion77 commented on June 14th 19 at 21:09
June 14th 19 at 20:50
Why do you have one form with 3 buttons sumbit? OK, it's not my business. Don't know how you can immediately send 3, try to cause all the forms submit event.
forma.dispatchEvent(new Event("submit"));
June 14th 19 at 20:52
well, to begin with what forms you have not 3, but 1.
The buttons on the form 3, although one is enough, at the end of the form(or in any other place inside the form tag).
How does the Ajax - mystery code because you have failed, and are drawn to work normally should not, because:
1) id - the unique identifier of the element that as be alluding to the fact that repeat for more items he shouldn't.
2) the form is submitted in its current form, the server will just transmit to the server the last 3 values from the entire set InputB, maybe the server will accept a string which will duplicate variable names, respectively the last received data will overwrite the previous one. This can be overcome by JavaScript, which will implement the anal a crutch, for example by reading the input 3 before the calling button. If you know a lot about perversions - a flag in hands.
3) as all 3 named inputof in groups the same - what's the point to distinguish between them? how to guess from which I send the data?
4) if you want 3 times to call the handler on the server - 3 times call Ajax request each time passing the next 3 values from InputB, do not forget that Ajax is an asynchronous function, run the following query it is best to hang on onsuccess previous request. Change the ID for each element on the unique, or get at all. The easiest way to do all inputy one group with the same class on it and choose group, for example $('.firstinputs')

Find more questions by tags JavaScriptHTML