html5 form novalidate详细实例
html5 form novalidate详细实例
formnovalidate novalidate
--><!doctype html>
<html>
<body><form action="demo_form.asp教程" method="get" id="user_form">
e-mail: <input type="email" name="userid" /><br />
<input type="submit" value="submit" /><br />
<input type="submit" formaction="demo_admin.asp" value="submit as admin" /><br />
<input type="submit" formnovalidate="true" value="submit without validation" /><br />
</form></body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset=utf-8 />
<title>html5 formnovalidate</title>
<style>
body, input, textarea {
font-family: "helvetica", arial, helvetica;
}
label {
display: block;
float: left;
clear: left;
text-align: right;
width: 100px;
margin-right: 10px;
}div { padding: 10px; }
fieldset { border: 1px solid #ccc; margin-bottom: 20px; }
</style>
</head>
<body>
<form>
<fieldset>
<legend>some bits about you</legend>
<div><label for="email">email:</label> <input id="email" name="email" type="email" required /></div><div><label for="url">homepage:</label><input id="url" type="url" name="url" /></div>
<div><textarea name="comment" cols="100" rows="5" required></textarea></div>
<div><input type="submit" value="save current state" formnovalidate /> <em>won't validate the form</em></div>
</fieldset><div><input type="submit" /> <em>i will validate the form</em></div>
</form>
</body>
</html>