Forms tag in HTML
👉 The forms tag is used to create an HTML form for user input..
👉 In this Blog i will show you how to create a form and its tags, attributes.
👉 Let's Start
Firstly we create a form start with <form> tag </form>
<form action="serverlink" method="POST" autocomplete="off">
<fieldset >
<legend> Registration form</legend>
Note: Firstly we create a Label tag
<label for="fname" class="fname"> First Name </label> </br>
👉We use input type ="text" for get a user information in text. like name address, and other info.
<input type="text" name="fname" id="fname"> </br> </br>
<label for="lname"> Last Name </label></br>
<input type="text" name="lname" id="lname"> </br> </br>
👉 When we want a user email id so we use input type="email"
<label for="email"> Email </label></br>
<input type="email" name="email" id="email"> </br> </br>
<label for="gender"> Gender: </label> </br>
<label for="Male"> Male </label>
👉 When we want a one option to select we use input type="radio"
<input type="radio" value="Male" name="radio" id="radio">
<label for="female"> Female </label>
<input type="radio" value="Female" name="radio" id="radio"> </br> </br>
👉 When we want a user input date and time so we use input type="datetime-local"
<label for="datetime">Date and Time</label></br>
<input type="datetime-local" name="datetime" id="dt"> </br> </br>
👉 When we want a user selection option so we use <select> and <optgroup> <option>
<label for="courses"> Select Courses:</label></br>
<select id="select">
<optgroup label="Website Designing">
<option value="HTML"> Basic HTML </option>
<option value="CSS">CSS`</option>
<option value="Javascript">Javascript`</option>
<option value="Bootsrap">Bootstrap`</option>
</optgroup>
</select> </br></br>
👉 When we want a user submit the form and we create a submit button for use <input type="button>
<input type="button" name="submit" id="submit" value="submit">
</fieldset>
</form>
Many more attributes in form tag you can use it and try those tags :
1 | password | gives input field to user to enter password |
2 | submit | defines submit button to submit inputs to host |
3 | reset | gives a button which erases all the inputs entered |
4 | radio | gives radio button on which only one option can be selected |
5 | checkbox | gives checkboxes which allows multiple selection of option |
6 | button | gives a button which can be pushed over and handle the event |
7 | file | gives facility to upload a file on form |
8 | image | gives button having image upon |
9 | color | defines a input field with specific color |
10 | date | gives a calendar to upload a date on form |
11 | datetime-local | gives a calendar to upload a date on form without time zone |
12 | gives input field to upload an email address | |
13 | month | gives input field to control over month |
14 | number | Gives input field to enter especially number |
15 | url | gives input field to enter the url address |
16 | week | gives input field to enter the week |
17 | Search | Defines a single line text field for entering a search string. |
18 | Tel | Defines an input field for entering the telephone number. |
19 | Range | gives the dragging range button to set the range |
Comments
Post a Comment