Tutorial for Type Attribute in php

What is Type Attribute?

It indicates the type of input element. It’s an empty tag. The default value is text.

Example:-

<input>

<input type=“text”>
  • Text – It defines a single-line text field.
<input type=“text”>
  • Password – A password field is like text field, the difference being that this control hides each typed character by displaying an asterisk(*) or bullets(●) instead of the character itself.
<input type=“password”>
  • Button – This is used to add a button on a web form to activate a script when an user click the button.
<input type=“button”>
  • Email – This field is used to add an email address or a list of email address to a form, where type=“email” is a value for the input type. The input format should be an email like example@gmail.com else it will prompt an error.
<input type=“email”>
  • Check Box – A check box is a small box, which when selected includes a checkmark. It is used to allow the user to select one or more than one of the options available on a web page. An User can select or clear the check box by clicking it
<input type=“checkbox”>
  • Radio Button – A radio button is used to create a series of options of which only one can be selected. It is displayed as a circle which when selected, displays a dot in the middle.
<input type=“radio”>
  • URL – The URL field is used to enter only the web addresses, in their correct format. If the URL is not entered in the correct format then the URL field validates the text field to enter web address.
<input type=“url”> 
  • Autofocus – helps in keeping the focus of mouse pointer on the input field.
  • Pattern – defines the regular expression of the text that should be entered in the text field.
  • Search Box – This is used to add a search box to a form.
<input type=“search”>
  • Tel – The tel type represents a one-line plain-text edit for entering a telephone number.
<input type=“tel”>
  • Range – Range input represents the input of limited range numerical values.
<input type=“range”>
  • Number – Number is used to validate the textbox only if the value within the field is a numerical value.
<input type=“number”>
  • File – This is used to upload a file on a web page. You also need to set the enctype=“multipart/form-data”
<input type=“file”>
  • Image – It represents either an image from which the UA enables a user to interactively select a pair of coordinates and submit the form, or alternatively a button from which the user can submit the form.
<input type=“image”>
  • Hidden – A hidden control stores the data that is not visible to the user on a web page. This control is used to submit some information, which can not be edited by user.
<input type=“hidden”>
  • Submit – A submit button is used to transfer form data to the URL specified in the <form action> tag.
<input type=“submit”>
  • Reset Button – A reset button helps user to clear all the data that they have entered in the text fields.
<input type=“reset”>

  • Date – This is used for input fields that should contain a date.
<input type=“date”>
  • Time – It allows the user to select a time.
<input type=“time”>
  • DateTime – It allows the user to select  date and time.
<input type=“datetime”>
  • Datetime-local – It allows the user to select a date and time.
<input type=“datetime-local”>
  • Month – It allows the user to select a month and year.
<input type=“month”>
  • Week – It allows the user to select a week and year.
<input type=“week”>
  • Color – It is used for input fields that should contain a color.
<input type=“color”>
Ashwani Kumar
Latest posts by Ashwani Kumar (see all)
Tagged : / / / / / /
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x