I have tried everything and the only function that doesn't work in my jQuery is jqBootstrapValidation()
. I really don't know why! Any help would be much appreciated.
Here is my code, I’m using Vue.js
.
<style></style>
<template>
<div class="panel panel-default">
<div class="panel-body">
<form id="settings" novalidate enctype="multipart/form-data">
<div id="settings-name">
<h3>Name</h3>
<div class="form-group">
<input type="text" class="form-control" required data-validation-required-message="Please enter your name.">
<p class="help-block text-danger"></p>
</div>
</div>
<div id="settings-email">
<div class="form-group">
<h3>E-Mail</h3>
<input type="email" class="form-control" required data-validation-required-message="Please enter your email address.">
<p class="help-block text-danger"></p>
</div>
</div>
<div id="settings-password">
<h3>Password</h3>
<div class="form-group">
<input type="password" class="form-control" required data-validation-required-message="Please enter a password.">
</div>
<div class="form-group">
<input name='password' type="password" class="form-control" placeholder="Re-enter new password" data-validation-matches-match='password' data-validation-matches-message='passwords do not match' required data-validation-required-message="Please re-enter a password.">
<p class="help-block text-danger"></p>
</div>
</div>
<div id="settings-save">
<h3>Save</h3>
<button type='submit' v-on="click: saveAccountSettings">Save</button>
</div>
</form>
</div>
</div>
</template>
<script>
var $ = require('jquery')
module.exports = {
methods: {
validate: function() {
$("input,textarea").jqBootstrapValidation({
submitError: function($form, event, errors) {
console.log('error')
},
submitSuccess: function($form, event) {
console.log('success')
}
});
}
}
}
</script>