Thanks Pullo, I tried using your demo as a starting point, but had some trouble when I tried adding back all of the stuff I had stripped out for simplicity.
I had an idea which I think could be easier.
Rather than have the main form validate the hidden field I’m getting rid of the hidden field all together. Instead I want to disable the submit button and then enable it after they add a vehicle.
So I disabled the submit button and placed this inside of the function that adds a vehicle. This is working.
document.getElementById("next2").disabled=false;
The problem is when someone select any of the items in the main form it re-enables the button. How do I turn this off so the button stays disabled until I call the above code in the add vehicle script.
<script type="text/javascript">
$(document).ready(function() {
$('#step2').bootstrapValidator({
message: 'This value is not valid',
excluded: ':disabled, :hidden',
live: 'enabled',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
submitHandler: function(validator, form, submitButton) {
alert("Successful Form Submit");
},
excluded: ':disabled',
fields: {
coverage: {
validators: {
notEmpty: {
message: 'Please select level of coverage'
}
}
},
creditRating: {
message: 'Please Make a Selection',
validators: {
notEmpty: {
message: 'Please Make a Selection'
}
}
}// end dropdown
} // end fields
});// bootstrapValidator