Click here to Skip to main content
15,892,480 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Loading controls dynamically Pin
minhpc_bk23-Aug-05 21:50
minhpc_bk23-Aug-05 21:50 
Generalinfobar Pin
Sam 200623-Aug-05 18:47
Sam 200623-Aug-05 18:47 
GeneralRe: infobar Pin
T1TAN23-Aug-05 22:50
T1TAN23-Aug-05 22:50 
GeneralRe: infobar Pin
Sam 200624-Aug-05 5:51
Sam 200624-Aug-05 5:51 
GeneralRe: infobar Pin
T1TAN24-Aug-05 6:01
T1TAN24-Aug-05 6:01 
GeneralJAVASCRIPT HELP Pin
dgap23-Aug-05 8:26
dgap23-Aug-05 8:26 
GeneralRe: JAVASCRIPT HELP Pin
Guffa23-Aug-05 9:16
Guffa23-Aug-05 9:16 
GeneralTitle: textarea character counting question (javascript) Pin
pduncan8823-Aug-05 5:06
pduncan8823-Aug-05 5:06 
Hi everyone,

I have a countChars function (javascript) for my textarea box: The functions uses a textarea, and textbox. User is only allowed to type up to "maxLength" characters in the textarea and the characters remaining is displayed in the textbox.

function countChars(controlToValidateRef, maxLength,outputControlRef, errorMessage, enableClientSideRestriction,showJavascriptAlert,showCharacterCount)
{
var countString = maxLength - controlToValidateRef.value.length;
if (countString < 0) {
if (enableClientSideRestriction) {
controlToValidateRef.value = controlToValidateRef.value.substring( 0, maxLength );
if (showJavascriptAlert) {
alert(errorMessage);
}
return false;
}
} else {
if (showCharacterCount) {
outputControlRef.value = countString;
}
}
}

I'm using this function for the following events (onkeyup,onChange,OnFocus,OnBlur) of the textarea

This works in every scenario, except when a user uses the browser to paste in text. Any way to detect this???

Thanks,
Paul
GeneralRe: Title: textarea character counting question (javascript) Pin
Sarvesvara (BVKS) Dasa23-Aug-05 17:27
Sarvesvara (BVKS) Dasa23-Aug-05 17:27 
GeneralSetting Content-type charset for HTML Pin
Anonymous22-Aug-05 11:06
Anonymous22-Aug-05 11:06 
QuestionQuestion - Key Generation (Activation) Pin
Mike Doner22-Aug-05 10:30
Mike Doner22-Aug-05 10:30 
GeneralRe: Question - Key Generation (Activation) Pin
Christian Graus22-Aug-05 11:04
protectorChristian Graus22-Aug-05 11:04 
GeneralAbt html drop down combo Pin
Anita Mistry22-Aug-05 0:12
Anita Mistry22-Aug-05 0:12 
GeneralRe: Abt html drop down combo Pin
Guffa22-Aug-05 6:17
Guffa22-Aug-05 6:17 
GeneralDownload Pin
Kasumwal21-Aug-05 22:05
Kasumwal21-Aug-05 22:05 
GeneralRe: Download Pin
Guffa22-Aug-05 1:16
Guffa22-Aug-05 1:16 
GeneralRe: Download Pin
Anonymous22-Aug-05 2:01
Anonymous22-Aug-05 2:01 
GeneralRe: Download Pin
Guffa22-Aug-05 8:38
Guffa22-Aug-05 8:38 
GeneralSimple web service question Pin
Vecta21-Aug-05 21:47
Vecta21-Aug-05 21:47 
GeneralRe: Simple web service question Pin
Vecta23-Aug-05 21:03
Vecta23-Aug-05 21:03 
Generalcan't figure is out Pin
Tim Zorn21-Aug-05 12:45
Tim Zorn21-Aug-05 12:45 
GeneralRe: can't figure is out Pin
alex.barylski21-Aug-05 13:21
alex.barylski21-Aug-05 13:21 
GeneralRe: can't figure is out Pin
Tim Zorn21-Aug-05 14:08
Tim Zorn21-Aug-05 14:08 
GeneralRe: can't figure is out Pin
Tim Zorn21-Aug-05 15:00
Tim Zorn21-Aug-05 15:00 
GeneralRe: can't figure is out Pin
Guffa21-Aug-05 19:15
Guffa21-Aug-05 19:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.