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
success
When calling setTimeout(), wrap your command in an anonymous function. Otherwise the command will be executed immediately.
setTimeout(function() {$('#forgot-form').modal('hide');}, 4000);