Link to home
Start Free TrialLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

time validation

Hi,

I have two fields first one is Date identified and the second is time occurred
I want to say if Date Identified has a value then Time occurred is required.

this is what I have that is not working.

Thanks,
Lulu

<INPUT style="TEXT-ALIGN: center; WIDTH: 175px; HEIGHT: 23px" id=DateIdentifiedtxt value=03/28/2014 name=DateIdentifiedtxt data-format="MM/dd/yyyy" jQuery110205894598305599419="43">
</INPUT >


<INPUT style="TEXT-ALIGN: center; WIDTH: 165px; HEIGHT: 23px" value=00:00:00 name=TimeOccurredTxt data-format="hh:mm:ss" jQuery110205894598305599419="62">
</INPUT >


function ValidateForm()
{
	var DateIdentified = $("#DateIdentifiedtxt").val();
	var TimeOccurred = $("#TimeOccurredTxt").val();
	
	if (DateIdentified != "" && (TimeOccurred === null || TimeOccurred === undefined || 
	TimeOccurred === '00:00:00'))
	{		
		alert("Time Occurred is required");
		return false;
	}
}

Open in new window

Avatar of leakim971
leakim971
Flag of Guadeloupe image

you should try to validate your HTML first : http://validator.w3.org/
Avatar of lulu50

ASKER

not sure what you mean by that

What is that link for? lol lol don't know what to do with it lol lol
ah I'm glad it's Friday.
ASKER CERTIFIED SOLUTION
Avatar of GowthamNatarajan
GowthamNatarajan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What is that link for? lol lol don't know what to do with it

Put URL of your web page in the address field
Avatar of lulu50

ASKER

GowthamNatarajan,

When I put in a real time, it tells me that the time field is undefined.

not sure why
Avatar of lulu50

ASKER

Thank you