I'm stuck with 2 forms on a single bootstrap page that don't don't seem to validate. Each form is using a different validation but since I'm not pointing out to any specific form ID in my .js files, the first .js file is applied to each form. I'm struggling go get each .js validation file to apply to the correct form.
On my index.html page, I have something like:
<form name="sentMessage" id="contactForm" novalidate>
...
<form name="sentOrder" id="orderForm" novalidate>
...
<script src="js/jqBootstrapValidation.js"></script>
<script src="js/contact.js"></script>
<script src="js/order.js"></script>
Each .js file looks like:
$(function() {
$("input,textarea").jqBootstrapValidation({
preventSubmit: true,
submitError: function($form, event, errors) {
// additional error messages or events
},
submitSuccess: function($form, event) {
event.preventDefault(); // prevent default submit behaviour
// get values from FORM
var nameSender = $("input#orderNameSender").val();
If I try $("#orderForm").(function() and $("#contactForm")(function() it doesn't work. Thanks in advance for your help!
$(".testStack").jqBootstrapValidation({<form name="sentOrder" id="orderForm" class="testStack" novalidate>