One or more forms in a HTML data input | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

One or more forms in a HTML data input

Hi, maybe it’s a basic question - I have a massive HTML front end data input sheet. It is divided in to sections and each Section is a separate form (form1, form2... formx). So my question are: 1) should the whole massive document be only one form with like 500 input fields or it could be left with this 10 other “sub”forms each with 2) If I have more than one form at the same time how should I submitting the data - one button for each form of one button that submits all forms in the same time? Thanx!

8th Nov 2018, 8:03 PM
pap
pap - avatar
10 Answers
+ 1
If you really want to keep sections of forms, you can😃 You can have sub forms. For submitting, you can hide all other buttons and by JavaScript you can code new submit button that can click other hidden buttons. When user clicks the button, all the forms will be submitted.
8th Nov 2018, 8:25 PM
Roneel
Roneel - avatar
+ 2
Note: I don't know SQL😜 But I think you can do either way. Good to see someone familiar with SQL comes.
8th Nov 2018, 8:39 PM
Roneel
Roneel - avatar
+ 1
JavaScript function doesn't actually submit forms, it 'clicks' the hidden submit buttons of the forms.
8th Nov 2018, 8:31 PM
Roneel
Roneel - avatar
+ 1
Only if you want to store the data. If not, no back end needed
8th Nov 2018, 8:34 PM
Roneel
Roneel - avatar
+ 1
Yes👍
8th Nov 2018, 8:40 PM
Roneel
Roneel - avatar
+ 1
Roneel thanks a lot!!! you really helped me!!
8th Nov 2018, 8:41 PM
pap
pap - avatar
0
Roneel did i get this right - i should add a javascrip/jquery function that submits all forms at the same time after the user clicks one button or closes the browser (idiot-proof rule).
8th Nov 2018, 8:29 PM
pap
pap - avatar
0
Roneel - i need a php code then. on the back-end?
8th Nov 2018, 8:32 PM
pap
pap - avatar
0
Roneel - the HTML data input must be storted in SQL database and ovewrite, if any, already existing data in SQL. this is a separate question - do i need one big SQL table or like 25 small secondary-key related tables? if so is it possible after submitting the data all the tables to be filled?!
8th Nov 2018, 8:36 PM
pap
pap - avatar
0
Roneel - sorry back to original question - i need a JS function to click all buttpns and then i need a second php code to submit the data as soon as the submit buttons are clicked? and i can retain the sub-forms. did i got this right?
8th Nov 2018, 8:39 PM
pap
pap - avatar