Diffrent type of HTML5 New From input Attibutes

This article describe you about different type of HTML5 New From <input> Attributes
  • 2288

HTML5 New from <input>

<input> formnovalidate Attribute

This is a boolean value attributes. And it specifies that <input> element should not be validated when page submitted.

It is override the novalidate attributes of the <form> element.
Note: It is used for "submit" button.

<!DOCTYPE html>
<html>
<body>
<form action="default.aspx">
Enter Email: <input type="email" name="Uid" /><br />
<input type="submit" value="Submit" /><br />
<input type="submit" formnovalidate="formnovalidate" value="Submit without validation" />
</form>
</body>
</html>

<input> formtarget Attribute

It is define the name or keyword which define that where to display the response which is received by the server after submitting the form.

The target attributes of the <form> element overrides by the formtarget attribute.

Note: It is used with the type="submit" and type="image"

Example:

 

<!DOCTYPE html>
<html>
<body>
<form action="default.aspx">
Enter First name: <input type="text" name="fname" /><br />
Enter Last name: <input type="text" name="lname" /><br />
<input type="submit" value="Submit normally" />
<input type="submit" formtarget="_blank" value="Submit to The new window/tab" />
</form>
</body>
</html>


<input> height and width Attributes

This attribute is used to specify height and width of the <input> element.
Note: This attributes are only work with <input type="image">.

Note2: This attributes always specify height and width both for images. If height and width are specify then the space required for the image is reserved at the time of page is loaded. Browser does not know about height and width if don't set this attributes, and cannot reserve the appropriate space for it. 

 

<input type="image" src="myimage.jpg" alt="Submit" width="50" height="50"/>

<input> list Attribute

It is contain <datalist> element, and <datalist> contain the pre-define some option for an <input> element.

 

<input list="browsers" />
<datalist id="browsers">
<option value="Firefox">
<option value="Safari">
<option value="Chrome">
<option value="Opera">
<option value="Internet Explorer">
</datalist>

<input> min and max Attributes

This attributes specify the min and max value for an <input> element.
Note: This attributes works with these input types: number, range, date, datetime, datetime-local, month, time and week.

 

<!DOCTYPE html>
<html>
<body>
<form action="default.aspx">
Enter a date before 1985-05-05:
<input type="date" name="Hday" max="1980-12-01"><br />
Enter a date after 2002-05-05:
<input type="date" name="Hday" min="2002-06-06"><br />
Item No (between 1 and 10):
<input type="number" name="Item no" min="1" max="10" /><br />
<input type="submit" />
</form>
</body>
</html>

<input> multiple Attribute

It is accept Boolean value, and this attributes specified  that user can enter multiple value into the <input> element.

Note: This attributes work with the "Email" and "file"

 

Select images: <input type="file" name="image" multiple="multiple" />

Further Readings

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.