[thelist] ASP - actions taken before redirect? (again)

darren darren at web-bitch.co.uk
Fri Sep 28 06:39:20 CDT 2001


On 28 September 2001 at 12:07:06, Warden, Matt <mwarden at mattwarden.com> wrote:

WM> sgd's the one who suggested i change it from 'if trim(sField)="" then' to
WM> 'if isEmpty(trim(sField)) then'

WM> in fact, when that other comment came up, i did some testing and
WM> responded, as you can see on the article.

i read both the comments, and thought that something was screwy...so i
whipped up a quick script and had a go:

   dim sText
   Response.Write "dim'd isEmpty(sText): " & isEmpty(sText) & "<br />"
   sText = trim(Request.Form("text"))
   Response.Write "form isEmpty(sText): " & isEmpty(sText) & "<br />"

gives:
   dim'd isEmpty(sText): true
   form isEmpty(sText): false

and the latter is *always* false regardless of what i stick in the text
box and how i submit the form (hit the button or 'enter').

also:
no trim statement          gives form isEmpty(sText): false
isEmpty(trim(sText))       gives form isEmpty(sText): false
form field doesn't exists  gives form isEmpty(sText): false

which is pretty much as i'd expect as you've tried assigning a value to a
variable and have thus initialized it.  isEmpty is looking to see whether
a variable has been initialized.

WM> i could not reproduce what the two of you are suggesting. maybe it's a
WM> version thing?

currently running VBScript ver 5.6, but i'm sure i've had the same thing
on previous versions.

stranger and stranger,

darren





More information about the thelist mailing list