On Add -> Validate issue!

On Add -> Validate issue!

What I am trying to do is the following:

I have a form where people can register whether they are coming to the game or not...

They have to fill in there name and they have to enter a date.

Now I want to check if a user is already registered before submitting the form. Because duplicates are restricted.

I use the following piece of code:

  1. if(count(Attendees[name == input.name]) > 0 && input.Date == '26-FEB-2011' || input.Date == '04-MAR-2011')
  2. {
  3. alert "You are already registered for this date.";
  4. }

Following happens:
If the user registers for 26th of February the form submits the data to the database, thats fine.
BUT when the same user wants to register for the 4th of March the alert pops up...

How can I solve this???