Using the onKeyUp Event of the Textbox itemPlotSummary we are passing (this) [Is this the control name?]
(this) is a reference to the input element itself. No need to do getElementById(). You can use this function as is
function ShowNumberOfCharactersleft(textSource)
{
// the only thing you might need to change is RemainingCharacters. You just need to use the client ID of the element in which you wish to display the count.
document.getElementById('RemainingCharacters').innerHTML = textSource.value.length.toString();
}
Ask Me About: Kentico, XHTML, CSS, Javascript, Asp.Net C#, SQL Server.
jiveabillion
Contributor
4222 Points
775 Posts
Re: how can I check the number of characters entered into textbox prior to DB update?
Nov 12, 2010 06:50 PM|LINK
(this) is a reference to the input element itself. No need to do getElementById(). You can use this function as is
function ShowNumberOfCharactersleft(textSource) { // the only thing you might need to change is RemainingCharacters. You just need to use the client ID of the element in which you wish to display the count. document.getElementById('RemainingCharacters').innerHTML = textSource.value.length.toString(); }Learn the LifeCycle
Free Online Games