1 回答
TA贡献1827条经验 获得超7个赞
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$("#txtDate").change(function() {
const selDate = new Date(this.value);
const dayOfMonth = selDate.getDate();
const month = selDate.getMonth() + 1;
const dayOfWeek = selDate.getDay();
if (month === 11 && dayOfMonth === 2) {
$(".form-control").val(100);
}
else if (dayOfWeek === 0) {
$(".form-control").val(500);
}
else {
$(".form-control").val(300);
}
})
});
</script>
<input type="date" name="mass_date" id="txtDate" required="required" class="col-md-12" min="<?php echo date('Y-m-d', strtotime("+2 days")); ?>" max="<?php echo date("Y-m-d", strtotime("2020-09-30"));?>" value="<?php if(isset($_GET['mass_date'])) { echo $_GET['mass_date']; } ?>" />
<input type="text" class="form-control" id="slDay" name="amount" />
添加回答
举报