Showing posts with label Calendar.setup. Show all posts
Showing posts with label Calendar.setup. Show all posts

Thursday 19 April 2018

Calendar.setup Calendar popup not display proper on Magento admin panel


HTML Code

<td class="label"><label for="tran_date">Date</label></td>
<td class="value">
    <input name="deposit[created_at]" id="tran_date" type="text" class="input-text" value="<?php echo Mage::getModel('core/date')->gmtDate('m/d/Y'); ?>"/>
    <img src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" class=""
        id="tran_date_trig"/>
    <div id="calendar--flat"></div>
</td>
</tr>
SCRIPT
 <script type="text/javascript">
// <![CDATA[
Calendar.setup({
flat: 'calendar--flat',
ifFormat: '%m/%e/%Y',
button: 'tran_date_trig',
align: 'Bl',
singleClick: true,
onSelect: function(dateText,selectedDate) {
    jQuery('#tran_date').val(selectedDate);
    jQuery('#calendar--flat').hide();
}
});
// ]]>
</script>

CSS

#calendar--flat {
    position: absolute;