0

FORMS AND JS

Hey all so Ive been playing around quite a bit with html and trying to improve my JS skills. One thing that I kind of struggle with is forms for some reason. Ive noticed that there are several ways to set up forms. for example: you can make a button of a form a <button> or an <input> or you can set up the entire form <form onsubmit= ""> or a button <button/input onsubmit="">. Im wondering if someone could help explain which use is best for different situations...

20th Oct 2019, 12:34 AM
Chad Williams
Chad Williams - avatar
1 Odpowiedź
+ 1
Form is for sending data to server. You have to learn one backend skill, be it PHP or Node.js, for accepting the data. For the form elements, most important attributes is name, for backend to retrieve data. For the submit method, there are put and post, (insert and replace).
20th Oct 2019, 6:55 AM
Gordon
Gordon - avatar