Skip to main content

learn html 5 Forms Pt. 1: Input Types

Additional input types

Basic form fields created using the inputelement include text, password, checkbox, radio, and submit, which have already been covered in the HTML Beginner section. These types have been extended in HTML5 to accommodate more specific fields:

Search

Used for a search query text box, this performs exactly as a standard text input should.

<input type="search" name="search">





Telephone, URL, and email addresses

Other “special” text input types include tel, for telephone numbers, url, for web addresses, and email, for email addresses.

<input type="tel" name="telephone_number">
<input type="url" name="web_address">
<input type="email" name="email_address">





Numbers and ranges

A simple text box that also allows a user to directly type in a number, or cycle through numbers (usually using an up and down arrow to the side of the field), can be achieved withtype="number". A further step attribute can be added to specify how much is added or subtracted from the number with each increment.
If you also want the number to have a minimum or maximum value, you can further use the minand max attributes.

<input type="number" name="quantity" step="2" min="20" max="30">
Once again, if this is supported, the user will be able either to type directly into the field or, if using the arrows, cycle between 20 and 30, two units at a time.





An alternative to the digits-in-a-text-box approach can be achieved using type="range". By default, this should be displayed as a horizontal bar with a slider in the middle of it. The user can then adjust the slider left and right, the far left resulting in a value of “0” and the far right a value of “100”. This range can be adjusted using the min and max attributes.

<input type="range" name="temperature" min="15" max="25" step="0.5" value="18.5">

Dates and times

There are several input types for dates and times:
  • type="datetime"
  • type="date"
  • type="month"
  • type="week"
  • type="time"
  • type="datetime-local"
If supported (they aren’t, widely, and they are also inconsistent between browsers), these will prompt the user to enter a date or time in a specific format, either by directly typing it in, cycling through one week/day/hour/minute/etc. at a time, or by selecting from a dropdown calendar.





Color

Finally, type="color" is designed to allow a user to select a color, sending a six-digit hex code as its value.

<input name="color" type="color" value="#ff8800">

Popular posts from this blog

Free tips to save yourself from phishing

Free tips to save yourself from phishing Phishing is a type of social building method utilized by programmers to assemble delicate data, for example, usernames, passwords and Visa points of interest by acting like a trustworty individual/association. Since most online clients are ignorant of the methods utilized as a part of completing a phishing assault, they regularly fall exploited people

Free internet browser download :internet explorer

Internet explorer full free downloads Internet explorer 11.0.11 full free download Internet explorer 10.0 full free download Internet explorer 9.0 full free download internet ex plorer lastest version download these are the lastest version of internet explorer...if you want anything else then let me by sending me comment i will try my best to give that...............

tricks to Hack an Email using Hardware Keylogger

tricks to Hack an Email using Hardware Keylogger Equipment Keyloggers are utilized for keystroke logging, a system for catching and recording machine client keystrokes. They connect to between a machine console and a machine and log all console action to an inward memory. They are intended to work with PS/2 consoles, and all the more as of late with USB consoles. An equipment keylogger seems just as a USB pendrive (thumb drive) or some other machine fringe so that the victimized people can never