Class Rooms Reservations - On Submit validations - Class Room, time and date

Class Rooms Reservations - On Submit validations - Class Room, time and date

Hi all,

Still struggling with my class rooms reservation.
I need to put a validation routine to prevent duplicated reservations, so i have to check it in my form:

1 - The class rooms introduced
2 - The Date of reservation introduced
3 - and the START and END time introduced
 
Problems:

My Form have lookups numbers fields for Start and End time (like 9,10,11,12,13,14...). So I have to code to prevent same Class rooms, at the same date, and at the same time.

How do I do this??????

I thinking in this examples of reservations for the same classroom and at the same date:
(remember this are number fields representing hours)

Start field "10"  End field "12" - Accept this
Start field "12"  End field "14" - Accept this
Start field "16"  End field "19" - Accept this

Then in the next submits:

Start field "9"  End field "11" - Reject  this - and make and Alert msg "Already reserved."
Start field "8"  End field "22" - Reject  this - and make and Alert msg "Already reserved."
Start field "11"  End field "17" - Reject  this - and make and Alert msg "Already reserved."

Hope this was self explanatory, because my English is  like  my programmer knowledge.... very very basic...


Here is my application form:
http://creator.zoho.com/ccongressos/copy-of-reservas-centro-de-congressos/#Form:Reservas

My next step is to make cost calculations based on this 3 variables  (room, date, and time)
Any suggestions?

Thanks for  the all help i can get!!

CCongressos (Asilva)