Foundation 4 is not allowing to overwrite its regular expression for form
validation using abide
I want to overwrite password pattern provided by foundation(zurb) but its
not identifying my overwritten regular expression
and generated error according to its by default expression. By
default,passwords validation provided by foundation is "must be at least 8
characters with 1 capital letter, 1 number,
and one special character". For that I have used following: 1)
<head>
<script>
$(document)
.foundation()
.foundation('abide', {
patterns: {
new: ^[a-zA-Z]\w{3,14}$,
}
});
</script></head>
<body>
<form class="custom" data-abide>
<div class="row">
<div class="large-12 columns">
<label>Password <small>required</small></label>
<input type="password" pattern="new" required >
<small class="error" data-error-message="">validation
error.</small>
</div>
</div>
</form>
</body>
2)
<form class="custom" data-abide="">
</form>
3)Directly used pattern in input tag:
<input type="password" pattern="^[a-zA-Z]\w{3,14}$" required >
But all these are not working.Please suggest me something to resolve my
problem.
You can find the sample program - here
No comments:
Post a Comment