Skip to main content

HTML 5: Different input types - input type email

HTML 5 have added many input types. This is one of the feature which really has made HTML 5 awesome and interesting to use. Those some input types are as below:
- email
- url
- number
- tel
- date




inputy type="email"

Now on need to write scripts to validate emails any more. With HTML 5, it can be done with just an input type

First try the code below:
<form action="" method="post">
<input type="email" required />
<input type="submit" value="Submit" />
</form>

Output:







What is does? First when you define any input type as required, users need to give any value. Secondly, as it is email so any format won't exceptable. It must be in the form of email. Wow!! isn't it simply great.

Now keep on adding some more properties like below:
<form action="" method="post">
<input type="email" required autofocus placeholder="Enter a valid email address" size="25"/>
<input type="submit" value="Submit" />
</form>

Output:



What it does?? It simply autofocus first as you open that page with autofocus and secondly you will see the text "Enter a valid email address" in the text box.

Simply great isn't it!!

Comments

Popular posts from this blog

CSS List

CSS allows you to customize the lists that can be made with HTML  to the extent that even images can be used as bullet points for unordered lists. CSS List Style Type If you want to use something different from the default numbering of ordered lists, or the bullets/discs of unordered lists, then all you have to do is choose a different style for your lists. CSS allows you to select from a wide variety of different list item shapes. Unordered list styles: square, circle, disc (default), and none Ordered list styles: upper-alpha, lower-alpha, upper-roman, lower-roman, decimal (default), and none Code:

Accessible Forms

Forms aren't the easiest of things to use for people with disabilities. Navigating around a page with written content is one thing, hopping between form fields and inputting information is another. Because of this, it is a good idea to add a number of elements to the form. Labels Each form field should have its own label. The label tag sorts this out, with a for attribute that associates it to a form element:

Join in MySQL

Join clause is used to combine rows from two or more tables depending upon common field between them. There are different kinds of Joins. The most common and useful Join is Inner Join. Inner Join: It will return all rows from multiple tables where the condition is met.