*Dear Friends,*
*I need to use a text counter in an aspx page.*
*I wrote the javascript, but the counter s not showing when the program is
runed.*
*The page has included a master page.*
*Where should i include this coding?*
*It didnt worked when i placed it in contentplaceholder,** in UpdatePanel
and Script Manager.*
*Can anyone help?*
*Code:*
*
<
script language="javascript" type="text/javascript">
function
textCounter(field, countfield, maxlimit) {
if
(field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.innerText = maxlimit - field.value.length +
" characters remaining";
}
function
doPaste(control) {
maxLength = control.attributes[
"maxLength"].value;
value = control.value;
if
(maxLength){
event
.returnValue = false;
maxLength = parseInt(maxLength);
var
oTR = control.document.selection.createRange();
var
iInsertLength = maxLength - value.length + oTR.text.length;
var
sData = window.clipboardData.getData("Text").substr(0,iInsertLength);
oTR.text = sData;
}
}
</
script>*
* *
--
****************
**Thanks & Regards,
Jeena Ajiesh
Email: [email protected]
[email protected]*