Bootstrap Succes Message disappears -
i have bootstrap form , there have ajax code give data .php script.
the problem is, ajax code shows success message 1 second , disappear after that.. here code:
$( '#frmcontact').submit( function() { var formcheck = true var name =$( '#name' ); if(name.val() == '') { $( '#name-group-name' ).addclass( 'has-error' ); $('#name-group-name').append('<div class="help-block">' + 'error' + '</div>'); // add actual error message under our input return false; } if(formcheck) { $.ajax({ type: "post", url: "process.php", // data: $('frmcontact').serialize(), success: function(msg){ $( '#message' ).addclass( 'alert' ); $( '#message' ).addclass( 'alert-success' ); $( '#message').html( msg ); }, error: function(){ alert("failure"); return false } }); } } );
thanks!
you can set custom time following way:
settimeout(function(){ $(".alert-success").addclass('hide'); }, 5000);
Comments
Post a Comment