Posted By

nerdfiles on 04/06/11



Versions (?)

Button Disable on Unload

 / Published in: jQuery

This doesn't work. Don't use it. click occurs before unload so the user can click n-times before the unload event fires. Consider disabling the button itself. For validation plugins, consider checking if the form itself was sent. If the validation plugin doesn't have an API for this, either drop it or consider disabling the button itself and enabling on other events that do not affect the plugin (like mouseout or blur). We should define our target audience when developing (assistive technology, screen-reader) and we should understand clearly what the actual problem is, instead of across-the-board fixes that prompt more problems than they solve.

  1. $(window).bind('unload', function(e) {
  3. $('input[type="button"]').attr('disabled', 'disabled');
  5. });

Report this snippet  

You need to login to post a comment.