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();
});
精彩评论