Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / November 2004

Tip: Looking for answers? Try searching our database.

Handling NULLs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Cosmas - 24 Nov 2004 15:40 GMT
I need help handling NULLs.  Where is fails is the "    if((_values != null)
|| (_values != ""))  ".  It is supposed to detect the NULL and then execute
the ... = "" statement.  When I add a window.alert statement, it returns a
NULL, but the IF clause here fails for some reason and pumps the NULL into
the textbox anyways.

  if(row.getRowType() == "Record")
  {
   var _cell = null;
   var _values = "";
   _cell = row.getCellByColumnKey("DueDate");
   _values += _cell.getValue();
   if((_values != null) || (_values != ""))
   { document.frmCaseSummary.txtPleadingsDueDate.value = _values;  }
   else
   { document.frmCaseSummary.txtPleadingsDueDate.value = "";   }
  }
  else
  {
   document.frmCaseSummary.txtPleadingsDueDate.value = "";
  }

Please help.

TIA
John Cosmas
Chris R. Timmons - 26 Nov 2004 05:16 GMT
> I need help handling NULLs.  Where is fails is the "  
> if((_values != null)
[quoted text clipped - 20 lines]
>     document.frmCaseSummary.txtPleadingsDueDate.value = "";
>    }

John,

Change the || to &&.  In other words, the if statement should read
like this:  "if _values is not equal to null, AND _values is not
empty, then..."

Signature

Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.