Defining input names for validation errors

This commit is contained in:
rockstardev
2018-08-17 10:30:49 +02:00
parent af015d435b
commit ed36fba0d7

View File

@@ -34,12 +34,12 @@
</div>
<div class="form-group">
<label>Checkout Description</label>
<input type="text" class="form-control" placeholder="(optional)"
<input name="checkoutDesc" type="text" class="form-control" placeholder="(optional)"
v-model="srvModel.checkoutDesc" v-on:change="inputChanges">
</div>
<div class="form-group">
<label>Order Id</label>
<input type="text" class="form-control" id="inputAddress" placeholder="(optional)"
<input name="orderId" type="text" class="form-control" id="inputAddress" placeholder="(optional)"
v-model="srvModel.orderId" v-on:change="inputChanges">
</div>
<div class="form-group">
@@ -119,7 +119,7 @@
</div>
</div>
<div class="row" v-show="errors.any()">
<div class="col-lg-12">
<div class="col-lg-12 text-danger">
Please fix errors shown in order for code generation to successfully execute.
</div>
</div>
@@ -141,6 +141,15 @@
<script type="text/javascript">
var srvModel = @Html.Raw(Json.Serialize(Model));
Vue.use(VeeValidate);
const dictionary = {
en: {
attributes: {
price: 'Price', checkoutDesc: 'Checkout Description', orderId: 'Order Id',
serverIpn: 'Server IPN', emailToNotify: 'Send Email Notifications', browserRedirect: 'Browser Redirect'
}
}
};
VeeValidate.Validator.localize(dictionary);
var payButtonCtrl = new Vue({
el: '#payButtonCtrl',
data: {
@@ -224,7 +233,5 @@
return inputChanges().replaceAll("&lt;", "<").replaceAll("&gt;", ">");
}
});
</script>
}