Bootstrap 4 Form Validator | 1.1.0

1
2
function focusIt(el) {
$('input[name="'+el+'"]').focus();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
using:

First, set up the input fields you want:

<form @submit.prevent="login(event.target)">
<input name='username' class='form-control' data-validate="required|len[3,16]|alphanum|nospace">
</form>

then, trigger the plugin:

login: function(e) {
$(e).validate(function(result) {
if (result.success) {
alert('Success!');
} else {
alert(result.msg);
}
})
}

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.