is there any character counter
-
hi.. i m using an HTML DIV to input text for description.. i want to limit charactors up to 800.. for this i want a counter which will show the remaining characters, when user start typing...could u plz tell how can i do that.. thanks
-
hi.. i m using an HTML DIV to input text for description.. i want to limit charactors up to 800.. for this i want a counter which will show the remaining characters, when user start typing...could u plz tell how can i do that.. thanks
This is what i do to when using a testfield field is the textfield and countfield is a div showing the amount of remaining chars I dont understand why you are using a div as an inputfield? txtText.Attributes.Add("onkeypress","textCounter('"+txtText.ClientID+"','Main1_createAdvertControl_lblLettersUsed');"); function textCounter(field, countfield) { var maxlimit = 300; f = document.getElementById(field); c = document.getElementById(countfield); if (f.value.length > maxlimit) f.value = f.value.substring(0, maxlimit); else c.innerHTML = maxlimit - f.value.length; } Wyx :cool: