Сообщение от kot_k_k
|
внести дату в другой элемент
|
строки 21 , 22
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Icon trigger</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/sunny/jquery-ui.css">
<style type="text/css">
#ui-datepicker-div{
font-size: 12px;
margin-top: 20px;
}
</style>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script>
$(function() {
$(".date_:checkbox").each(function(indx, el) {
var picer = $(el).prev().datepicker({
dateFormat: 'yy-mm-dd',
altField: el,
altFormat: "yy-mm-dd"
});
$(el).on({
'click': function() {
this.checked ? picer.datepicker("show") : (picer.val(0),this.value=0);
}
})
});
});
</script>
</head>
<body>
<input class ="date_" type="hidden" id="Date_1" name="Date_1" value="0"/>
<input class ="date_" id="IN_1" name="IN_1" type="checkbox" value="1" />
<input class ="date_" type="hidden" id="Date_2" name="Date_2" value="0"/>
<input class ="date_" id="IN_2" name="IN_2" type="checkbox" value="1" />
<input class ="date_" type="hidden" id="Date_N" name="Date_N" value="0"/>
<input class ="date_" id="IN_N" name="IN_N" type="checkbox" value="1" />
</body>
</html>