Free Jobs
Reference




Dot Net Forums: ASPNET (77) C#.NET (39) VB.NET (8) AJAX (21) Silver Light (1) WCF (10) WPF (1) WWF (1) .NET 3.5 (3) SQL SERVER (38) Other (3)

Topic: Can you explain some important attribute for input type in HTML 5

To get the Posted Questions details daily in your mail Click Here

Share this Post on Facebook/Twitter/Orkut Bookmark and Share





User: rajiv100 Post Date: 25 Jan 2012 09:15

Introduction:
Can you explain some important attribute for input type in HTML 5



Main Content:
Below are the list of some important attribute for input type in HTML 5



1.Datalist attribute for input elements in HTML5

  The Datalist attribute for input elements in HTML5

  is just like combobox that helps in selecting one item

  out of a group of text.

  An example is given below.



    <input type="text" name="enviroment" list="enviromentList">

    <datalist id="enviromentList">

      <option value="Test"/>

      <option value="QA"/>

      <option value="Production"/>    

    </datalist>



 

2.Placeholder attribute for input elements in HTML5

  The place holder attribute for input elements in HTML5

  is just like the water text Text boxes for input type

  the text appears when the textbox is empty

  and disappears if data is entered.

  An example is given below.

 <input type="text" name="Search" placeholder="Search" />



3.Pattern attribute for input elements in HTML5

  The Pattern attribute for input elements in HTML5

  is just like the regular expression validator.

  It takes the regular expression as input

  and validates the input against it.

  An example is given below.

 <input type="text" name="URL" Pattern="HTTP://" />

 

4.autocomplete attribute for input elements in HTML5

 <input type="text" name="firstName" autocomplete="off" />

 The autocomplete attribute for input elements in HTML5

  is just like remebering the previosly entered text in that control

  and displying on focus like intellisense.

  This can be turned off for security.

 



5.min and max attribute for input elements in HTML5

min and max attribute for input elements in HTML5 is used to set

min and max validation for an input type as shown below.

<input type="number" name="salary" placeholder="sal" min="10000" max="20000" />

this can be used for number and date/datetime/time input type.



6.step min and max attribute for input elements in HTML5

step is used in conjuction with min and max attribute for

input elements in HTML5 is used to set

min and max validation for an input type as shown below.

<input type="number" name="salary" placeholder="sal" min="10000" step ="1000" max="20000" />

This means that only salaries like 10000,11000,12000 ...up to 20000 are allowed

this can be used for number and date/datetime/time input type.



7.required attribute for input elements in HTML5

 <input type="text" name="Name" autocomplete="off" required />

 required attribute for input elements in HTML5

  is just like required field validator and is used as above.





8.autofocus attribute for input elements in HTML5

 <input type="text" name="Name"  autofocus />

 autofocus attribute for input elements in HTML5

  puts the focus on the control when page is loaded.



9.multiple attribute for input elements in HTML5

 <input type="file" name="images" multiple />

 multiple attribute for input elements in HTML5

  is for selecting multiple file at one go.

  It is used as shown above.

Conclusion:
These are some important attribute for input type in HTML 5



About Writer:
Hi,I am .NET Developer From Bangaloret


Writer's Link:

Writer's Email:







Comments:
Post Comment





Similar Articles Top ArticlesLatest Articles Other Articles by this Author







www.freejobsreference.com Copyright © 2009-2011 | All Rights Reserved
All content of this website is protected by copyright laws and should not be reproduced in any form or by any means without written permission
(Best viewed in IE 8.0+ or Firefox 3.0+ at resolution of 1024 * 768 or higher)