Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error checking on Null return data

Status
Not open for further replies.

tmf

MIS
Feb 25, 2003
24
US
I have an application where you query data against a date range. You fill in the requested date ranges and submit, and the return data displays the actual date ranges for the data returned.

Something like:
Requested Date Range: 2003-12-20 to 2003-12-29
Actual Date Range: 2003-12-20 to 2003-12-22

I need to present the user with a statement if there is no return data for the dates requested. In other words the actual date values are null.

Requested Date Range: 2003-12-20 to 2003-12-29
Actual Date Range: to

I am a javascript beginner so please keep that in mind.

Thank you very much for your thoughts.

Sicnerely,

tmf
 
Jammer,

The variables are as follows:

fromDate
toDate

HTH.

Tim
 
Tim,

You haven't given me much to go on, but would something like this do the trick:

Code:
	function checkDates()
	{
		if ((fromDate == '' || typeof(fromDate) == 'undefined') && (toDate == '' || typeof(toDate) == 'undefined'))
			alert('There was no data returned!');
		else
			alert('Here\'s your data:...');
	}

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top