HTML TUTORIALS-
-HTML Form Attributes Tag β
Introduction-
πΉHTML form attributes are used to define the behavior and functionality of the <form> element. Here are the most commonly used attributes:..
β 1. action:-
Specifies where to send the form data when the form is submitted.
<form action="/submit-form">
</form>
β 2. method:-
πΉ Defines the HTTP method used to send form data-
πΉ get (default): Appends data to the URL.
πΉ post: Sends data in the body (more secure for sensitive info).
<form method="post">
β 3. enctype:-π
πΉ All Specifies how the form data should be encoded when submitting to the servers-
πΉ application/x-www-form-urlencoded (default)
πΉ multipart/form-data (for file uploads).
πΉ text/plain.
<form enctype="multipart/form-data">
</form>
β 4. target:-π
πΉ All Specifies where to display the response received after form submission.-
πΉ _self (default)
πΉ _blank (new tab)
πΉ _parent
πΉ _top
<form target="_blank">
<!-- Form fields go here -->
</form>
β 5. autocomplete:-π
πΉ Toggles browser auto-complete features on form fields-
<form autocomplete="off">
β 6. novalidate:-π
πΉ Disables HTML5 validation when submitting the form-
<form novalidate>
β 7. name:-π
πΉGives the form a name for scripting purposes.-
<form name="contactForm">