We help IT Professionals succeed at work.

Available times on a form, based on popup calendar date picker

Adker
Adker asked
on
2,024 Views
Last Modified: 2008-03-17
Currently a user selects a date from a popup calendar, this date is then put into the text box. Works fine.

The next two drop down boxes contain times that are availbale based on the date returned from the calendar. These drop down boxes are populated thru Javascript when the fields are clicked, onClick. Functionaly it works, but it is a bit cluncky.

It takes two clicks, one to call the javascript and one to see the available choices. The first click also causes the page to blink as the drop downs are populated.

onChange for the date field does not work.

I'd like to return the available times as well as the date when the user selects their date from the popup. Is this possible. Any other ideas on how to make this transparent to the user while keeping it all on a single page?

The following link will take you to our demo. You will need to click continue to get the page with the calendar popup.

Thanks in advance for any and all responses.

John

http://www.hospitality101.com/demo/catertrax/shopaddtocartnodb.asp?productname=stuff&price=30.00

The calendar javascript is here:
http://www.hospitality101.com/demo/catertrax/calendar.js
Comment
Watch Question

Hi,

I haven't had a chance to look particularly in-depth to solve your problem, however a quick solution that will work only in IE would be to use the event onpropertychange rather than onchange.  If you remove the onfocus event of the date selection and place the onpropertychange event of the date field to point to strother1_OnMouseOver, then you will get the desired effect (however, only in IE).

Regards,
-PA

Author

Commented:
Good point, but originally we had the IE only solution. Requirements changed and we needed to update.

Thanks for taking the time to look it over!
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Oh just a little FYI.  If you're wondering why onChange doesn't work it's because onChange fires when the element's focus is lost IF the value has changed...this is not the same as firing when the value changes. So if a user clicks a text field, makes some changes, and clicks off, the test to see whether or not the value has changed occurs when the user clicks off and NOT when the value changes.

Author

Commented:
Your suggestions worked great. Thank You
Happy to help :)  One of the best things about programmers & programming is the community..., I can't imagine any industry where it's this easy to get good specific help for your problems.

Good luck with your project

-PA
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.