【发布时间】:2011-11-03 13:01:34
【问题描述】:
我在我的一个项目中使用DATE RANGE PICKER JQUERY plugin。日期框是使用此 HTML 代码呈现的
<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>
我这样调用函数
$(function(){
$('#dateRange').daterangepicker();
});
然后它起作用了,它将值返回到#dateRange输入框
但是现在当我单击整个跨度标记#arrowDate 时我需要它工作,我使用此代码来完成此操作
$(function(){
$('#arrowDate').daterangepicker();
});
日期范围选择器弹出,但是当我选择我的日期时,我需要它来将日期插入#dateRange 输入框中,有没有办法做到这一点?
【问题讨论】:
-
为什么不将点击方法附加到跨度并调用 $('#dateRange').daterangepicker();ž
-
@Senad - 我做了,但它没有显示日期范围选择器
-
@Senad 我做了以下 $(document).ready(function() { $('#arrowDate').click(function() { $('#dateRange').daterangepicker() ; }); });
标签: jquery jquery-plugins