HTML5 Validations


Radio Button

<input type=”radio” name=”radio” value=”avi” required=”required”>

textbox

<input type=”radio” name=”test” id=”input” required value=”1″ />

<input id=”name” name=”name” value=”” aria-describedby=”name-format” required aria-required=”true” pattern=”[A-Za-z-0-9]+\s[A-Za-z-‘0-9]+”  title=”firstname lastname”>

Checkbox

<input type=”checkbox” required name=”terms”>

textarea 

<textarea rows=”4″ cols=”50″ name=”comment” required></textarea>

Website

<input type=”url” name=”website” required>

Email Address

<input type=”email” name=”email” required placeholder=”Enter a valid email address”>

Age

<input type=”number” size=”6″ name=”age” min=”18″ max=”99″ value=”21″>

Satisfaction

<input type=”range” size=”2″ name=”satisfaction” min=”1″ max=”5″ value=”3″>

date

<input type=”date” name=”date” required>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s