Skip to content

Commit

Permalink
added an test page for custom onsubmit event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
tipiirai committed Sep 17, 2010
1 parent 0787db6 commit 05284ff
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
26 changes: 26 additions & 0 deletions test/validator/onsubmit.htm
@@ -0,0 +1,26 @@

<!DOCTYPE html>
<script src="../js/jquery-1.4.2.min.js"></script>
<script src="../../src/validator/validator.js"></script>

<form action="#" style="margin:100px">

<label>
requred text
<input type="text" required="required" />
</label>

<button>Submit</button>

</form>

<script>
$("form").validator({ position: 'top center'}).submit(function(e) {

// flag to see whether validation failed
var failed = $(":input", this).hasClass("invalid");

// do not perform submit
e.preventDefault();
});
</script>
19 changes: 0 additions & 19 deletions test/validator/validator.htm
Expand Up @@ -21,26 +21,7 @@
padding:0 5px;
}
</style>

<!--
input attributes in HTML5
# min
# max
# pattern
# required
# maxlength (no need to)
# disabled
# readonly
# oninvalid
- replace (next version perhaps)

type
# number (good with max / maxlenght)
# email
# url
# range (range)
# date, datetime, month, time, week (dateinput)
-->

<form action="#">

Expand Down

0 comments on commit 05284ff

Please sign in to comment.