I have just started HTML5 and want to know in general if we should use one <form>
tag per web page or multiple form tags.
Maybe it depends on the situation, but here are two different scenarios:
Is it bad to have a form tag inside another or is it ok per standards?
Thanks
Edit Can you please explain in a simple way what the purpose of the form tag is?
I feel like you've already answered your questions.
Just don't nest them.
EDIT
Form tags are meant to hold a variety of fields (i.e. input tags) that you will eventually pass to a target URL using a GET or POST request.
Take this login form, for example:
<form action="login.php"> <input id="name" type="text" name="name"> <input id="passwd" type="password" name="passwd"> <input type="submit" value="Login"> </form>
This has a login, a password, and a submit button. When the "Login" button (type = "submit") is pressed, the form will take that information and send it to another URL (in this case, "login.php", and that URL will handle the information accordingly (e.g. validate, sign you in, display captcha).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With