var text = $('#' + textid).val();
var textlength = text.split(' ').length;
if (textlength > limit+1) {
$('#' + infodiv).html('You cannot write more then ' + limit + ' words!');
alert("word limit exeed..!!")
$('#' + textid).val(text.substr(0, limit));
return false;
}
else {
$('#' + infodiv).html('You have ' + (limit - textlength) + ' Words left.');
return true;
}
}
$(document).ready(function() {
$('#ctl00_Content_TxtResponseOne_ctl02_ctl01').keyup(function() {
limitChars('ctl00_Content_TxtResponseOne_ctl02_ctl01', 200, 'ctl00_Content_ROneCount');
})
$('#ctl00_Content_TxtResponseTwo_ctl02_ctl01').keyup(function() {
limitChars('ctl00_Content_TxtResponseTwo_ctl02_ctl01', 500, 'ctl00_Content_RTwoCount');
})
$('#ctl00_Content_TxtResponseThree_ctl02_ctl01').keyup(function() {
limitChars('ctl00_Content_TxtResponseThree_ctl02_ctl01', 500, 'ctl00_Content_RThreeCount');
})
$('#ctl00_Content_TxtResponseFour_ctl02_ctl01').keyup(function() {
limitChars('ctl00_Content_TxtResponseFour_ctl02_ctl01', 1000, 'ctl00_Content_RFourCount');
})
$('#ctl00_Content_TxtResponseFive_ctl02_ctl01').keyup(function() {
limitChars('ctl00_Content_TxtResponseFive_ctl02_ctl01', 500, 'ctl00_Content_RFiveCount');
})
$('#ctl00_Content_TxtResponseSix_ctl02_ctl01').keyup(function() {
limitChars('ctl00_Content_TxtResponseSix_ctl02_ctl01', 500, 'ctl00_Content_RSixCount');
})
$('#ctl00_Content_TxtResponseSeven_ctl02_ctl01').keyup(function() {
limitChars('ctl00_Content_TxtResponseSeven_ctl02_ctl01', 500, 'ctl00_Content_RSevenCount');
})
$('#ctl00_Content_TxtResponseEight_ctl02_ctl01').keyup(function() {
limitChars('ctl00_Content_TxtResponseEight_ctl02_ctl01', 500, 'ctl00_Content_REightCount');
})
$('#ctl00_Content_TxtResponseNine_ctl02_ctl01').keyup(function() {
limitChars('ctl00_Content_TxtResponseNine_ctl02_ctl01', 800, 'ctl00_Content_RNineCount');
})
});
<
table width="100%" border="0" cellpadding="0" cellspacing="0" runat="server" id="Table1">
<tr>
<td align="left" valign="top" width="60%" class="grey_ver11">
<cc2:editor width="600px" height="150px" runat="server" id="TxtResponseOne">cc2:editor><%
--
<td align="right" class="grey_ver11" valign="top" width="40%">
<div id="ROneCount" class="DefaultTextBoxCounterStyle" runat="server">
div>
td>
tr>
table>
This jquery is working for Html mode of editior bue not working for ythe design mode of it. do any one have solution.
Anusha SrivastavaPosted Jun 7, 2011, 4:14 AM
Anusha SrivastavaPosted Jun 7, 2011, 4:11 AM
and the thing i know is that in html sorce their are two iframes and a textarea the textarea contain the text we right.
And if i pass the iframeid then the code dosen't work at all either the HTML mode is selected Or the Design mode.
Suthish NairPosted Jun 7, 2011, 4:00 AM
Anusha SrivastavaPosted Jun 7, 2011, 2:58 AM
Jaganathan BantheswaranPosted Jun 6, 2011, 5:23 AM
Why should you use a method to limit the characters, there should be some property to limit the character right.