Hi All,

I have to do a validation on date in my form. I get a string of the format "dd/mm/yyyy" in my form. now i have to check that this date should be of the past including the present week(for eg. if I add the entry on 04/09/2007 then all the values upto 08/09/2007 should be valid) . Can anyone tell me how should I do this validation?

Thanks,
Megha

Recommended Answers

All 3 Replies

there are several classes that can help you do this, for instance the 'Date' class (but I think the one I'm thinking of is for a large part deprecated)

scrolling through the api's from sun 'll propably get you quite far allready, all you need to do is figure out the right logic behind your own program.

> I have to do a validation on date in my form.
Look into the SimpleDateFormat and GregorianCalendar classes to achieve your task.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.