Skip to content

Instantly share code, notes, and snippets.

@boyofgreen
Created April 4, 2012 01:59
Show Gist options
  • Save boyofgreen/2297099 to your computer and use it in GitHub Desktop.
Save boyofgreen/2297099 to your computer and use it in GitHub Desktop.
HTML5 Hacks 2.4
<!DOCTYPE html>
<html>
<body>
<form id="myForm">
Add your telephone: <input type="tel" name="phone" autocomplete=”on” /><br />
</form>
<input type="submit" form="myForm" />
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<form id="myForm">
Add your telephone: <input type="tel" name="phone" required /><br />
</form>
<input type="submit" form="myForm" />
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<form action="demo_form.asp" autocomplete="on">
First name:<input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
E-mail: <input type="email" name="email" /><br />
Favorite Animal: <input type="text" name="animal" list="animals" /><br />
<datalist id="animals">
<option value="Dog">
<option value="Dolphin">
<option value="Duck">
<option value="Cat">
<option value="Bird">
<option value="mouse">
</datalist>
<input type="submit" />
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<form action="demo_form.asp" autocomplete="on">
First name:<input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
E-mail: <input type="email" name="email" /><br />
ID Number: <input placeholder="enter your 5 digit id number" type="text" name="idNumber" pattern="[0-9]{5}" /><br />
<input type="submit" />
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<form>
Add your telephone: <input type="tel" name="phone" required /><br />
<input type="submit" />
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment