How can I unobtrusively disable submit buttons with Javascript and Prototype?

后端 未结 4 1726
失恋的感觉
失恋的感觉 2021-01-25 03:19

So I found this recommendation, but I can\'t quite seem to figure out how.

This is the code I originally started with:

   function greySubmits(e) {
              


        
4条回答
  •  被撕碎了的回忆
    2021-01-25 04:07

    document.observe("dom:loaded", function(){
       $$('form').find(function(thisForm) {
          Event.observe(thisForm, 'submit', function(event) {
             $$('input[type="submit"]').find(function(input) {
                input.value = 'Please wait ...';
                input.setAttribute('disabled',true);
                });
             });
          });       
       });
    

提交回复
热议问题