Bài đăng

Đang hiển thị bài đăng từ tháng 2 19, 2016

Clearing dialog input fields

× Add Comment Value textareavalues Save changes Close $('#myModal').on('hidden.bs.modal', function () {             $('.modal-body').find('lable,input,textarea').val('');                 });

Bootstrap modal close after 4 seconds or user click

Hình ảnh
How would I set a timeout for a bootstrap modal? After getting the ajax data back that the message returned by php contains the term  success , I want to give the user the option to close the window. However, I also just want to have a 4 second count down. Currently the second the success message comes back the modal hides itself. $ ( '#forgotform' ). submit ( function ( e ) { "use strict" ; e . preventDefault (); $ ( '#forgotsubmit' ). button ( 'loading' ); var post = $ ( '#forgotform' ). serialize (); var action = $ ( '#forgotform' ). attr ( 'action' ); $ ( "#message" ). slideUp ( 350 , function () { $ ( '#message' ). hide (); $ . post ( action , post , function ( data ) { $ ( '#message' ). html ( data ); document . getElementById ( 'message' ). innerHTML = data ; $ ( '#message' )