Getting data into an input field from YUI Calendar with multi-select:true
- by kylex
<script type="text/javascript">
YAHOO.util.Event.onDOMReady(function(){
YAHOO.dateSelects.exc = new YAHOO.widget.Calendar("exc","excContainer",
{ title:"Choose a date:", close:true, multi_select:true });
YAHOO.dateSelects.exc.render();
YAHOO.util.Event.addListener(
"excshowup",
"click",
YAHOO.dateSelects.exc.show,
YAHOO.dateSelects.exc,
true
);
});
</script>
<div class="calendarOuterContainer">
<div id="excContainer" class="calendarContainer"></div>
</div>
<a id="excshowup"><img src="/images/icons/calendar.png" /></a>
The preceding code generates a YUI calendar with the ability to select multiple dates on one calendar. What I am having trouble figuring out is how to capture that data and place it inside a text input tag on the fly. So when a person clicks the close button, all the selected dates are populated inside the input tag.
Suggestions?