Answer the question
In order to leave comments, you need to log in
How to link one form to another?
<form id='form1'>
<input type='text' name='text1'>
<a href="#form2">Ссылка</a>
</form>
<form id='form2'>
<input type='text' name='text2'>
<button type='submit'>Отправить форму </button>
</form>
Answer the question
In order to leave comments, you need to log in
I haven't tested it but I think it should work.
const formData1 = new FormData( document.getElementById('form1') );
const formData2 = new FormData( document.getElementById('form2') );
for(const [key, value] of formData2.entries()) {
formData1.append(key, value)
}
return formData1;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question