Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Empty text box


Message #1 by "Kathy Egan" <kathy.egan@h...> on Mon, 18 Feb 2002 17:53:46
Does anyone know of any other way to determine that a text box has no 

value other than X="" or X=null?  I've got an integer field that I'm 

querying from the database.  The field is <null> in the database, and when 

I display it on the screen it seems to be empty, but when I check to see 

if it's empty by the condition 



if (X="" or X=null) then....



it fails the test (i.e., thinks it's got a value).  

Message #2 by "O'Hara, Elliott M" <EMOHARA@k...> on Mon, 18 Feb 2002 12:50:42 -0500
I <em>THINK</em> that a 0 would pass your test...



"" returns 0 for data type int...



right??



-----Original Message-----

From: Kathy Egan [mailto:kathy.egan@h...]

Sent: Monday, February 18, 2002 12:54 PM

To: ASP Web HowTo

Subject: [asp_web_howto] Empty text box





Does anyone know of any other way to determine that a text box has no 

value other than X="" or X=null?  I've got an integer field that I'm 

querying from the database.  The field is <null> in the database, and when 

I display it on the screen it seems to be empty, but when I check to see 

if it's empty by the condition 



if (X="" or X=null) then....



it fails the test (i.e., thinks it's got a value).  






$subst('Email.Unsub').

Message #3 by "Kathy Egan" <kathy.egan@h...> on Mon, 18 Feb 2002 18:09:46
I tested for "isNumeric" and it failed.  Here's the snippet of code I'm 

using...



flgRtnVal = false

if (isNumeric(pValue)) then

	if (pValue = 0 or pValue = null) then

		flgRtnVal = true

	end if

else

	if (trim(pValue = "") or pValue = null) then

		flgRtnVal = true

	end if

end if



If I try to test against 0 in the "else" clause, I get a type mismatch 

error.  If the value is some unprintable value, I don't know how to figure 

out what's it is.







> I <em>THINK</em> that a 0 would pass your test...

> 

> "" returns 0 for data type int...

> 

> right??

> 

> -----Original Message-----

> From: Kathy Egan [mailto:kathy.egan@h...]

> Sent: Monday, February 18, 2002 12:54 PM

> To: ASP Web HowTo

> Subject: [asp_web_howto] Empty text box

> 

> 

> Does anyone know of any other way to determine that a text box has no 

> value other than X="" or X=null?  I've got an integer field that I'm 

> querying from the database.  The field is <null> in the database, and 

when 

> I display it on the screen it seems to be empty, but when I check to see 

> if it's empty by the condition 

> 

> if (X="" or X=null) then....

> 

> it fails the test (i.e., thinks it's got a value).  

> 




> $subst('Email.Unsub').

Message #4 by "O'Hara, Elliott M" <EMOHARA@k...> on Mon, 18 Feb 2002 13:16:50 -0500
HAHA

shame on me...



its not 



its ==



:o)

change you code..



pValue == 0 or pValue == null

-----Original Message-----

From: Kathy Egan [mailto:kathy.egan@h...]

Sent: Monday, February 18, 2002 1:10 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Empty text box





I tested for "isNumeric" and it failed.  Here's the snippet of code I'm 

using...



flgRtnVal = false

if (isNumeric(pValue)) then

	if (pValue = 0 or pValue = null) then

		flgRtnVal = true

	end if

else

	if (trim(pValue = "") or pValue = null) then

		flgRtnVal = true

	end if

end if



If I try to test against 0 in the "else" clause, I get a type mismatch 

error.  If the value is some unprintable value, I don't know how to figure 

out what's it is.







> I <em>THINK</em> that a 0 would pass your test...

> 

> "" returns 0 for data type int...

> 

> right??

> 

> -----Original Message-----

> From: Kathy Egan [mailto:kathy.egan@h...]

> Sent: Monday, February 18, 2002 12:54 PM

> To: ASP Web HowTo

> Subject: [asp_web_howto] Empty text box

> 

> 

> Does anyone know of any other way to determine that a text box has no 

> value other than X="" or X=null?  I've got an integer field that I'm 

> querying from the database.  The field is <null> in the database, and 

when 

> I display it on the screen it seems to be empty, but when I check to see 

> if it's empty by the condition 

> 

> if (X="" or X=null) then....

> 

> it fails the test (i.e., thinks it's got a value).  

> 




> $subst('Email.Unsub').






$subst('Email.Unsub').

Message #5 by "Kathy Egan" <kathy.egan@h...> on Mon, 18 Feb 2002 18:28:45
Nevermind.  I figured it out.  The proper syntax for checking for null is:



isNull(pValue)   and not   pValue=null.



Sorry for the bother.



> I tested for "isNumeric" and it failed.  Here's the snippet of code I'm 

> using...

> 

> flgRtnVal = false

> if (isNumeric(pValue)) then

> 	if (pValue = 0 or pValue = null) then

> 		flgRtnVal = true

> 	end if

> else

> 	if (trim(pValue = "") or pValue = null) then

> 		flgRtnVal = true

> 	end if

> end if

> 

> If I try to test against 0 in the "else" clause, I get a type mismatch 

> error.  If the value is some unprintable value, I don't know how to 

figure 

> out what's it is.

> 

> 

> 

> > I <em>THINK</em> that a 0 would pass your test...

> > 

> > "" returns 0 for data type int...

> > 

> > right??

> > 

> > -----Original Message-----

> > From: Kathy Egan [mailto:kathy.egan@h...]

> > Sent: Monday, February 18, 2002 12:54 PM

> > To: ASP Web HowTo

> > Subject: [asp_web_howto] Empty text box

> > 

> > 

> > Does anyone know of any other way to determine that a text box has no 

> > value other than X="" or X=null?  I've got an integer field that I'm 

> > querying from the database.  The field is <null> in the database, and 

> when 

> > I display it on the screen it seems to be empty, but when I check to 

see 

> > if it's empty by the condition 

> > 

> > if (X="" or X=null) then....

> > 

> > it fails the test (i.e., thinks it's got a value).  

> > 




> > $subst('Email.Unsub').


  Return to Index