Checking for null value

Results 1 to 3 of 3

Thread: Checking for null value

  1. #1
    Join Date
    Dec 1969
    Posts
    247

    Default Checking for null value

    I have a form which has one textbox which should accept only numeric values. However, i have both javascript error checking and ASP error checking to trap for characters such as (a,b,c,..z). What i am having problem with is checking if someone submits the form without entering a value in the textbox. I have something like this........<BR>Is IsEmpty(reportid) then <BR> Response.Write "You did not enter a value, etc....."<BR>End If<BR>If IsNumeric(ch)= true or ch = "," or ch = " " Then<BR> &#039do nothing<BR>Else<BR> Response.Write "The ReportID (&#039"& reportid &"&#039) that you&#039ve entered is/are not correct. Please go &#060;a href=&#039javascript:history.go(-1)&#039&#062;back&#060;/a&#062; and correct your entry."<BR>response.end<BR>End If<BR><BR><BR>If i comment out the IsEmpty clause, the rest of my If statement works but not the IsEmpty part. Could you please help me? I need to finish this project. Thanks a million.

  2. #2
    ActiveALLI Guest

    Default RE: Checking for null value

    Use the IsNull funtion.<BR><BR>Returns a Boolean value that indicates whether an expression contains no valid data (Null).<BR><BR>Syntax:<BR>IsNull(expression)<BR>Th e expression argument can be any expression.<BR><BR>The following example uses the IsNull function to determine whether a variable contains a Null: <BR><BR>Dim MyVar, MyCheck<BR>MyCheck = IsNull(MyVar) &#039 Returns False.<BR>MyVar = Null &#039 Assign Null.<BR>MyCheck = IsNull(MyVar) &#039 Returns True.<BR>MyVar = Empty &#039 Assign Empty.<BR>MyCheck = IsNull(MyVar) &#039 Returns False.<BR><BR>ACTIVE ALLI<BR>OZ.COM<BR>

  3. #3
    ActiveALLI Guest

    Default RE: Checking for null value

    Use the IsNull funtion.<BR><BR>Returns a Boolean value that indicates whether an expression contains no valid data (Null).<BR><BR>Syntax:<BR>IsNull(expression)<BR>Th e expression argument can be any expression.<BR><BR>The following example uses the IsNull function to determine whether a variable contains a Null: <BR><BR>Dim MyVar, MyCheck<BR>MyCheck = IsNull(MyVar) &#039 Returns False.<BR>MyVar = Null &#039 Assign Null.<BR>MyCheck = IsNull(MyVar) &#039 Returns True.<BR>MyVar = Empty &#039 Assign Empty.<BR>MyCheck = IsNull(MyVar) &#039 Returns False.<BR><BR>ACTIVE ALLI<BR>OZ.COM<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •