开发者

Form doesn't submit in chrome if form submit button is disabled onclick

I am using YUI3 rich text editor and onclick of the submit button the editor saves the changes then the button is disable开发者_StackOverflowd

window.myEditor = new YAHOO.widget.SimpleEditor('textarea', myConfig);
    myEditor.render();
    YAHOO.util.Event.on('submitButton', 'click', function() {
        myEditor.saveHTML();
        document.getElementById('submitButton').disabled=true;
    });

in firefox everything works fine, editor applies the changes, then the button is disabled then form submits, but in chrome, only the button is disabled and nothing happens any ideas ?

note: button type is submit.


try

YAHOO.util.Event.on('submitButton', 'click', function() {
  myEditor.saveHTML();
  setTimeout(function() {
   document.getElementById('submitButton').disabled=true;
  }, 300);
});


it worked fine after disabling the button then saving the html:

window.myEditor = new YAHOO.widget.SimpleEditor('textarea', myConfig);
    myEditor.render();
    YAHOO.util.Event.on('submitButton', 'click', function() {
       document.getElementById('submitButton').disabled=true; 
       myEditor.saveHTML();      
    });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜