<script src="http://www.google.com/jsapi"></script>
<script>
// Load jQuery
google.load("jquery", "1.2.6");
</script>
<script src="http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/jquery.validate.js"></script>
<script src="http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/lib/jquery.metadata.js"></script>
<script>
// I set the debug option to true, so the data is not commited,
// enabling me to review the outcome.
$.validator.setDefaults({
debug: false
});
$().ready(function() {
// validate signup form on keyup and submit
$("#wwvFlowForm").validate({
//As soon as a key within a form field in “myform” is release then start
event: "keyup",
//Here the rules for the individual inputs are defined.
rules: {
p_t01: "required",
p_t02: "date",
p_t03: "required"
},
//Here the error messages for all rules are defined.
messages: {
p_t03: 'Please enter a Text'
},
//Optionally: This message appears, when the rules are met
success: function(label) {
label.html('ok').addClass("success");
}
});
});
</script> |