jquery validate not submitting after modal close bootstrap
- by Mariana Hernandez
I have a modal where i insert some data, but when i open the modal, close it, and the click the modal show button again, it doesnt submit of course because the validate is "acting" in the modal, but i closed it so its not showing... how can i prevent this? thanks
it is similar to this
jquery functions within modal only work on first open, after close and re-open they stop working
but my functions are
<script>
$(document).ready(function() {
$("#myModal").modal('show');
});
</script>
and the validation one
<script>
$(document).ready(function(){
$('#form1').validate(
{
ignore: "",
rules: {
usu_login: {
required: true
},
usu_password: {
required: true
},
usu_email: {
required: true
},
usu_nombre1: {
required: true
},
usu_apellido1: {
required: true
},
usu_fecha_nac: {
required: true
},
usu_cedula: {
required: true
},
usu_telefono1: {
required: true
},
rol_id: {
required: true
},
dependencia_id: {
required: true
},
},
highlight: function(element) {
$(element).closest('.grupo').addClass('has-error');
if($(".tab-content").find("div.tab-pane.active:has(div.has-error)").length == 0)
{
$(".tab-content").find("div.tab-pane:hidden:has(div.has-error)").each(function(index, tab)
{
var id = $(tab).attr("id");
$('a[href="#' + id + '"]').tab('show');
});
}
},
unhighlight: function(element) {
$(element).closest('.grupo').removeClass('has-error');
}
});
});
</script>
So i dont know how to apply the answer of the above =(