Reputation: 2998
Please be gentle, I am perplexed I can't figure this out... I was told to use the YUI library because it is the most accessible library and that it provided fallback when JavaScript was not enabled. I cannot figure out how I would get the selected date for a calendar widget when JavaScript is not enabled. Nothing seems to be posting on submit.I tried to bind to an input box instead of a div but it just ignored the binding. If JavaScript is enabled I can just push the selected value to an input box. Is this widget the exception to the rule since it binds to a div or is there a secret way to find out what the user has selected with JavaScript not enabled?
Upvotes: 0
Views: 483
Reputation: 680
Many YUI widgets are designed to enhance existing HTML, and fall back to something useful even if JS is turned off or broken. For example, a YUI TabView's core markup is a list of links; if you break JS, you still have those working links to click on.
But YUI Calendar is not a form element in and of itself -- instead you should think of it as an enhancer for form elements. Your instinct to attach it to an input element is the correct one. The good news is that the YUI gallery has a popup calendar, built on top of the base calendar, which is designed to bind to elements and appears below the element when the user focuses there.
This is a classic progressive enhancement scenario. If the user has JS, they get a fancy calendar. If not, they can still fill out the plain input field -- no harm done.
Upvotes: 1