This is my response.. How to display the error message? passwords do not match
{"errors": {"password": ["Passwords donot match"]}, "status": false, "msg": "Validation erro", "error-type": 0}
Currently my code is
<script>
regBox = new Vue({
el: "#regBox",
data: {
..........
response: {
message: '',
status: '',
state: '',
errors: '',
}
},
methods: {
handelSubmit: function(e) {
var vm = this;
data = {};
..............
$.ajax({
url: '',
data: data,
type: "POST",
dataType: 'json',
success: function(e) {
if (e.status)
{
alert(" Success")
}
else {
vm.response = e;
alert(" Failed")
}
}
});
return false;
}
},
});
</script>
My html code to display the same is
<p class="error">{{response.errors.password}}</p>
Currently i am getting error message as ["Passwords donot match"]
How to get only message as
Passwords donot match.. so, how can i able to get it.. can anybody help