ok heres what i have at the moment...

a booking system where admin enters the details of a booking of a room. The dates are kept in one table of the database (dates) each with an id. this is so that all other tables use the same unique date etc.
on the bookings add form at the moment i have populated a drop down list that is a query from the date table, once the user selects a date and hits submit it puts the corresponding id number from the dates table into the bookings table ...
(hope this is making sense) However, as there are 10 years worth of dates in the database, we have now decided that the drop down list is far to large and we want to use a simple popup calendar to select the date.

how can i convert the date that is selected into the corresponding id number and insert that into the bookings table?