http://codepen.io/eond/pen/WQNoPE
//jQuery library (Works with jQuery 1.4 and higher)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
//jQuery.html5form plugin
<script src="http://html5form.googlecode.com/svn/trunk/jquery.html5form-1.5-min.js"></script>
<script>
$(document).ready(function(){
$('#myform').html5form();
});
</script>
12-04-2011 - Added Support input type="image" & input type="button" (Thanks to @zguillez)
Just create your form according the HTML5 syntax and the script will execute itself.
It does not require extra classes. The plugin gets all the information from the HTML source.
Runs automatically when detects Internet Explorer, Opera or Mozilla Firefox.
If you want to get full browser and customization support read the Plugin Features section below.
<input type="text" placeholder="Full Name"/>
<input type="email" name="email" id="email"/>
<textarea maxlength="60" name="comment" id="comment"/>
<input type="text" name="lastname" required />
<input type="url" name="website" placeholder="http://"/>
<input type="text" name="lastname" autocomplete="off"/>
<script>
$('#myform').html5form({
async : false, // cancels the default submit method.
method : 'GET', // changes the request method.
action : 'respuesta.php', // changes the action method.
responseDiv : '#respuesta' // a content div to get the callback function response.
})
</script>
<script>
$('#myform_one').html5form({
method: 'POST',
});
$('#myform_two').html5form({
method: 'GET'
});
</script>
<script>
$('#myform').html5form({
colorOn: '#999',
colorOff: '#000'
})
</script>
<script>
//default English messages method
$('#myform').html5form({
messages : 'de', // Options 'en', 'es', 'it', 'de', 'fr', 'nl', 'be', 'br'
responseDiv : '#response'
})
//default Italian messages method
$('#myform').html5form({
messages: 'it',
responseDiv : '#response'
})
//custom message method, this one takes precedence over default messages
$('#myform').html5form({
emptyMessage : 'This is a required field',
emailMessage : 'This email address is not correct, please try again',
responseDiv : '#response'
})
</script>
<script>
$('#myform').html5form({
labels: 'hide'
});
</script>
<script>
$('#myform').html5form({
allBrowsers: true
});
</script>
12-04-2011 - Added Support input type="image" & input type="button" (Thanks to @zguillez)