2012-11-21 28 views
0

我在使用Ckeditor時遇到了一個大問題。 我希望我的客戶可以通過人員化頁面添加一個paypal捐贈按鈕。 當我的客戶想要添加自定義頁面時,他們使用ckeditor。使用CKeditor插入HTML表單不起作用

要添加PayPal按鈕,他們將不得不把剛纔複製/使用源模式粘貼下面的代碼:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
<input type="hidden" name="cmd" value="_donations"> 
<input type="hidden" name="business" value="[email protected]"> 
<input type="hidden" name="lc" value="US"> 
<input type="hidden" name="item_name" value="Try"> 
<input type="hidden" name="no_note" value="0"> 
<input type="hidden" name="currency_code" value="EUR"> 
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHostedGuest"> 
<input type="image" src="https://www.paypalobjects.com/fr_XC/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - la solution de paiement en ligne la plus simple et la plus sécurisée !"> 
<img alt="" border="0" src="https://www.paypalobjects.com/fr_XC/i/scr/pixel.gif" width="1" height="1"> 
</form> 

然而,當他們保存,莫名其妙的HTML是modifyed這一個:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
    &nbsp;</form> 

我不知道如何避免這種情況。 我認爲這是CKeditor配置中的一個選項,它取代了一些html代碼,但我不確定。

非常感謝您即將成爲意見,

安塞爾姆

+0

我只是試着粘貼此HTML編輯器上http://ckeditor.com/demo和獲取的數據通過的getData()方法。我沒有遇到任何問題。你確定你正在使用最新的CKEditor,並沒有一些非默認設置? – Reinmar

回答

0

這裏發生的事情是你一直在編輯器form,在內容的form。您不能在HTML中嵌套表單。你可能不得不想出一些標記化的標記替換機制來實現它。

我相信有一個可以幫助ckeditor的表單插件。

+0

不,這不是一個問題,如果他編碼正確的頁面。在CKEditor 3.x中,他只需要HTMLEncode對textarea的內容進行編碼,這種問題不會發生。 – AlfonsoML

+0

CKEditor的內容不是嵌套在「form」中 - 它在iframe中,因此它是單獨的作用域。 – Reinmar

0

檢查「文本格式」的CKEditor的下面應該是「全HTML」