Skip to main content

Forms Tag in HTML

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 :


1passwordgives input field to user to enter password
2           submitdefines submit button to submit inputs to host
3resetgives a button which erases all the inputs entered
4radiogives radio button on which only one option can be selected
5checkboxgives checkboxes which allows multiple selection of option
6buttongives a button which can be pushed over and handle the event
7filegives facility to upload a file on form
8imagegives button having image upon
9colordefines a input field with specific color
10dategives a calendar to upload a date on form
11datetime-localgives a calendar to upload a date on form without time zone
12emailgives input field to upload an email address
13monthgives input field to control over month
14numberGives input field to enter especially number
15urlgives input field to enter the url address
16weekgives input field to enter the week
17SearchDefines a single line text field for entering a search string.
18TelDefines an input field for entering the telephone number.
19Rangegives the  dragging range button to set the range

Try these attributes in form. T

follow my channel and get new notification on time:
Thanku


Comments

Popular posts from this blog

HTML BORDER WITH CSS

 Many Type of HTML Border We have many types of border in HTML. We can change it with border style and colors. So we discussed how to change a Border color and Style in HTML. 1.      Firstly we write a Code in Sublime Text and Save it to Borderwithcss file 2.      Secondly we link a stylesheet in  <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>change border style</title> <link rel="stylesheet" type="text/css" href="d:/html blog/style.css"> </head> <body> <p class="b1"> this is a normal paragraph for change border style with css</p> <p class="b2"> this is a normal paragraph for change border style with css</p> <p class="b3"> this is a normal paragraph for change border style with css</p> <p class="b4"...

What is CSS (Cascading Style Sheet)

Cascading Style Sheets (CSS): In the dynamic world of web development, HTML (Hypertext Markup Language) serves as the foundation, laying out the structure of a webpage. However, for a webpage to captivate its audience with visually appealing designs and layouts, it requires the artistic touch of CSS, or Cascading Style Sheets. 👉Defining CSS: CSS is a style sheet language used to describe the presentation of a document written in HTML or XML. It enables web developers to control the visual aspects of a webpage, such as colors, fonts, spacing, and positioning, without altering the underlying structure defined by HTML. The term "Cascading" in CSS refers to the order of priority the styles are applied, allowing for flexibility and consistency. 👉Separation of Concerns: One of the key principles of web development is the separation of concerns, and CSS plays a crucial role in achieving this. While HTML focuses on the structure and content of a webpage, CSS handles the aesthetics ...

Tables in HTML

How to Use Table tag in HTML In this blog we understand the table elements in HTML. How to Create a Tables in HTML Firstly we understand table elements.  1. when we create a table in editor type with <table> 2. after that we create a table row with <tr> 3. between <tr> we create table data <td> see it into sublime text editor <body> <table border="1px"> <caption> Student Data</caption> <tr> <td> Name</td> <td>Roll NO</td> <td>Marks</td> <td>total Marks</td> <td>Percentage</td> </tr> <tr> <td> JOhn</td> <td>32655</td> <td>250</td> <td>500</td> <td>50%</td> </tr> <tr> <td> Carter</td> <td>1254</td> <td>250</td> <td>500</td> <td>50%</td> </tr> </table> W...