if (sString.charAt(0)==" ")
{sString=sString.substring(1,sString.length);return trimString(sString);}
else if (sString.charAt(sString.length-1)==" ")
{sString=sString.substring(0,sString.length-1);return trimString(sString);}
else
return sString;
}
-----Original Message-----Robert,
From: Billy Cravens [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 28, 2001 10:12 AM
To: [EMAIL PROTECTED]
Subject: Re: Error message with JavaScriptIt doesn't do *exactly* the same thing. If you just check length, then it will not catch someone who types in spaces (with no characters)
--
Billy Cravens
HR Web Development, Sabre
[EMAIL PROTECTED]Robert Hinojosa wrote:
Henry,
This does the same thing.function checkForm()
{
frm = document.member_add_form;
if(!frm.FName.value.length) // this line creates a problem
{
alert("You left first name blank.") ;
return false;
}Robert
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 28, 2001 8:41 AM
To: [EMAIL PROTECTED]
Subject: Error message with JavaScriptHi guys,
When the two functions below are called I receive an error message:
JavaScript Error:
http://statweb/henry/test/member_add_form.cfm, line 120:
document.member_add_form.FName has no properties.
What is wrong? The Fname field is in a table on the member_add_form.cfm<script language="JavaScript">
function IsBlank(str)
{
var intBlank = str.search(/[^\s+]/);
if (intBlank)
{
noChars=str.search(/[^\S{str.length}]/);
}
else
{
noChars = 1;
}
if (noChars < 1)
{
return true;
}
else
{
return false;
}
}function checkForm()
{
if
(IsBlank(document.member_add_form.FName.value)) // this line creates
a problem
{
alert("You left one or more fields blank.") ;
return false;
}
}
</script>Thanks in advance,
Henry
-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org
------------------------------------------------------------------------- This email server is running an evaluation copy of the MailShield anti- spam software. Please contact your email administrator if you have any questions about this message. MailShield product info: www.mailshield.com
