I'm using the DATE RANGE PICKER JQUERY plugin in one of my project. The datebox is rendered using this HTML code
<span class="datePickUnity" id="arrowDate">
<input type="text" name="<?php echo $name; ?>" value="<?php echo $inputValue; ?>" id="<?php echo $id; ?>" class="datePickBox" />
<div class="calendarArrowBox"><img src="<?php echo $dirIMG; ?>/arrow.开发者_开发问答png" class="calendarArrow" alt="Select Date Range" /></div>
</span>
I call the function this way
$(function(){
$('#dateRange').daterangepicker();
});
then it works, it puts the value return into the #dateRange input box
But now I need it to work when I click on the whole span tag #arrowDate I do this by using this code
$(function(){
$('#arrowDate').daterangepicker();
});
the date range picker pop's up, but whern I select my date I need it to insert the date into the #dateRange input box, is there a way to accomplish this?
How about
$(function(){
$('#dateRange').daterangepicker();
$('#arrowDate').click(function (e) {
if ( !($('#dateRange').is(e.target)) )
$('#dateRange').click();
}
});
});
精彩评论