Just wondering if anyone has some javascript code or know where I might find some that will do the following:
Let someone select a date today or in the past but will not allow them to pick any future dates?
I need this for a feedback form and we need to let them put what day into the field but obviously they can't visit int he future and be giving feedback today
Any help would be great I just can't seem to find how to do this variation.<
Have you set up any server-side validation? I ask only because you're still going to want to do that even if you do get the JS working.
All things being equal, I would work on the server validation first, and then add in the JS next. I say that only because its the only way to be sure you get what you want. Some people turn JS off, others may not have the most current browsers (I still have a small number of people that visit the Jesus Joshua site using IE5.5...).<
If that's what they ask for, then that's what they ask for. However, it would be prudent to point out the number of people using extensions like NoScript. Not knowing about your client, I also wonder if they really understand or just know that "JavaScript" is one of those things they are supposed to ask for...
As for how to go about doing it, I seem to remember seeing a couple of validation frameworks out there that would simplify things. Its been so long since I last bothered with JS validation I don't recall the names off the top of my head. These days I just do all validation server side. It simplified my testing headaches.<
Yeah I know what you are saying but they are paying me for the JS and don't want to spend any other money. This is a customer that I am not going to just go ahead and do extra for them. But I have defiantly told them to do both but oh well.
Check over at http://www.codeproject.com/ - I seem to remember seeing a few there. Its been a while since I was last there as they were getting more .NET projects than anything else for a while. Its not that I have a thing against .NET, its just not what I'm doing right now.<