start date vs. end date
We use the calendar at two input fields, one as arriving and one as departure (with at least one night between). This works so far, but now we would like to compare the values to avoid mistakes, something like
if arriving >= departure set departure = arriving + 1 day and
if departure <= start_date set end_date = start_date + 1 (or vice versa, but we have to avoid departure < today + 1).
Also we want to calculate the nights in between.
Actually, we could write some js-functions for these questions, but our main problem is, that we can not start any function here. Neither onchange nor onblur is firing at the right time (onblur comes one round later, onchange is never acting).
Does anybody know a solution? Maybe this is just a question of setting the focus after using the calendar?
|