form validation problem
I'm trying to check for zero length strings entered into a <textarea> element
(using vbscript in ASP).
if body = "" then...
if len(body)=0 then...
(The var "body" comes from a textarea in my form.)
Now either of these methods work fine for checking whether "title" is a zero
length string. But then "title" comes from a <input type=text>, not a <textarea>
Can anyone help, please..?
Re: form validation problem
"LucyG" <firstname.lastname@example.org> wrote in message
> I'm trying to check for zero length strings entered into a
> (using vbscript in ASP).
When checking for zero length strings, always remember to trim
leading and trailing spaces first since the space character will
count as being part of the string.
strTest = " "
Len(strTest) 'Returns 1
'With leading and trailing spaces trimmed:
Len(Trim(strTest)) 'Returns 0
Hope this helps!
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center