HTML Tag
Form Tag
HTML Forms are one of the main parts of communication between a user and a web site or web application. HTML forms serve the purpose of collecting information provided by the users.
Forms tag equired to the take input from to the user who visit the websiteThis form is primarily used for the registration process, creating a profile on a website, or logging into an existing one, etc. Name, password, and other details are among the data gathered from the form. At this point, the form will receive input and post the information to backend applications. Thus, the data that they receive will be processed by the backend programme.There are various form element such as text fields, text area, drop-down list, select, checkboxes, radio, etc.
Attributes
1) Action :-
Form action tells us about the page name where form data has been processed.to send the data that the user will submit.
2) method :-
Method to be used to upload data. The two methods are GET and POST.
1) form - Get Method : - It has a limited length of the characters URL. we should not be use get to send some sensitive data. This method is better for non-secure data.
2)Form - Post Method : -Post method It has no size limitations. The submission of the any form with the method post it is secure data, can not be bookmarked.
3) Target :-
Specify the target window of frame where the result of the form action will be display. It takes values like blank,_self,_parent etc.
Form Tag program
<!Doctype html>
<html>
<Body>
<form>
<fieldset>
<legend>Log in </legend>
<label>Username: <input type="text"></label><br>
<label>Password: <input type="password"></label><br>
<input type="submit" value="Submit">
</fieldset>
</form>
</Body>
</html>
Form Tag output
Form Type
1) Input Type
The HTML <input> element is used to create interactive controls for web-based forms in order to data from the user a wide variety of types of input data and control widgets are available to the depending on the device and user agent.
1) <input type = "text">
A single line text field. We can use the maxlength and minlength attributes to specify the maximum length and minimum length of the value that can be entered.
Program
<html>
<body>
<form>
First name:<br>
<input type="text" name="firstname">
<br>
Last name:<br>
<input type="text" name="lastname">
</form>
</body>
</html>
No comments:
Post a Comment