2011-06-11 71 views
2

我使用的提交按鈕的YUI3富文本編輯器 和的onclick編輯保存更改然後按鈕在Firefox中禁用形式不鍍鉻如果提交表單提交按鈕被禁用的onclick

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

一切工作正常,編輯器應用更改,然後按鈕被禁用,然後形式提交,但在鉻,只有按鈕被禁用,什麼也沒有發生 任何想法?

注意:按鈕類型提交。

+0

你能否證實myEditor.saveHTML工作時,你*不*禁用按鈕? – cwallenpoole 2011-06-11 23:17:55

+0

是的,它的工作,並保存的HTML,之後,我想禁用按鈕,什麼不禁用它時,這是要求? – 2011-06-13 10:26:49

+0

與此相關嗎? http://www.google.com/support/forum/p/Chrome/thread?tid=152f74d4890dc84f&hl=zh-CN – 2011-11-19 21:56:54

回答

0

它禁用按鈕,然後保存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();  
    }); 
1

嘗試

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

這是什麼意思? – 2011-06-11 14:41:28

+0

點擊它後禁用300毫秒按鈕 – mplungjan 2011-06-11 14:42:42

+0

仍然無法工作:(:( – 2011-06-11 16:04:33