jQuery(window).load(function(){
jQuery("#eme-health-camp-checkin").bootstrapValidator({
message: "This value is not valid", excluded: [":disabled"], feedbackIcons: { valid: "glyphicon glyphicon-ok", invalid: "glyphicon glyphicon-remove", validating: "glyphicon glyphicon-refresh" }, fields: { emp_no: { group: ".response-field-text", validators: { notEmpty: { message: "Emp No is required and cannot be empty" } } },medical_station: { group: ".response-field-dropdown", validators: { notEmpty: { message: "Medical Station is required" } } }, }
}) .on("success.form.bv", function(e) { // Prevent form submission e.preventDefault();$(this).unbind( e ); $(".msg-status-row .alert").html("Successfully Validated! Please wait while processing your request.").removeClass("alert-danger").removeClass("alert-info").addClass("alert-success"); $(".msg-status-row .alert").slideDown(); $("#eme-health-camp-checkin").submit(); return false;
});
//Manually Add recaptcha validation into boostrap validation /*if( $("#g-recaptcha-response").length > 0 ){ $("#eme-health-camp-checkin").bootstrapValidator("addField", "g-recaptcha-response", { validators: { group: ".response-field-captcha", notEmpty: { message: "The captcha is required and cannot be empty" } } }); }*/
$("#resetBtn").click(function() { $("#eme-health-camp-checkin").data("bootstrapValidator").resetForm(true); });
});