Getting data into an input field from YUI Calendar with multi-select:true

Posted by kylex on Stack Overflow See other posts from Stack Overflow or by kylex
Published on 2010-06-16T16:41:35Z Indexed on 2010/06/16 17:22 UTC
Read the original article Hit count: 183

Filed under:
|
<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?

© Stack Overflow or respective owner

Related posts about calendar

Related posts about yui