0
我在同一頁上的應用程序中有4個微型MCE編輯器。我想將最大字數限制爲100(編輯器1 +編輯器2 +編輯器3 +編輯器4字數必須少於100個字)。每當我點擊提交按鈕的網頁應chaeck此驗證(或計數增加超過100時,然後點擊提交按鈕之前,應提醒用戶相同的頁面)微小的MCE編輯器中的字數限制
我已經經歷了許多在線解決方案,但無法瞭解如何實現此功能。
這裏是我的代碼:
<script type="text/javascript" src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
<script type="text/javascript" >
tinyMCE.init({
selector: 'textArea', // change this value according to your HTML
menu: {
edit: { title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall' },
insert: { title: 'Insert', items: 'link media | template hr' },
format: { title: 'Format', items: 'bold italic superscript subscript' },
tools: { title: 'Tools', items: 'spellchecker code' }
},
resize: 'both',
plugins: "wordcount",
encoding: "xml"
});
var myVar = parseInt($('#content-word-count').text());
if (myVar > 100){ "Your information exceeded than the max limit 100" };
</script>
<textarea id="editor1" rows="2" cols="20" runat="server" ></textarea> <br />
<textarea id="editor2" rows="2" cols="20" runat="server" ></textarea> <br />
<textarea id="editor3" rows="2" cols="20" runat="server" ></textarea> <br />
<textarea id="editor4" rows="2" cols="20" runat="server" ></textarea> <br />
<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
請幫助我。
這是回答您的問題嗎?如果是這樣,它將幫助他人將答案標記爲正確。如果沒有 - 您還有哪些問題? –