Below javascript is checking for length, if it exceeds over 15 char., it will automatically remove char. after 15. I am using this code for both Notes and Web client as Common Javascript.
I am having trouble in notes client. The message alert eventhough the value is less than 15 character long. Why? Please advise
if(document.forms[0].TargetNumSub.value!==“”)
{
if (TargetNumSub.value.length>15);
alert (“Target Number Of Subjects must not exceed more than Fiftheen characters. Please retype the information.”);
TargetNumSub.value.length is NOT the same thing as document.forms[0].TargetNumSub.value.length. Your code is looking for an object (TargetNumSub) that doesn’t exist.
And !== does not mean “is not equal to”, it means “is not identical to”. It is the “not” version of the identity comparator (===), not of the equivalency comparator (==). Identity means that the objects being compared are the same object, not that they have the same value.