Java 我通过JQuery为datepicker设置了文本框,但datepicker不工作
Jquery日期选择器不工作。这是我的密码。我知道我要么丢失了一些JS文件,要么包含了一些覆盖JS文件,但我想知道是哪一个 请检查我的代码,让我知道我缺少了什么,或者在js文件中额外添加了什么,这些文件阻止了jquery日期选择器。虽然,它在代码重构之前工作,但是在代码重构之后,它停止了工作Java 我通过JQuery为datepicker设置了文本框,但datepicker不工作,java,jquery,jsp,Java,Jquery,Jsp,Jquery日期选择器不工作。这是我的密码。我知道我要么丢失了一些JS文件,要么包含了一些覆盖JS文件,但我想知道是哪一个 请检查我的代码,让我知道我缺少了什么,或者在js文件中额外添加了什么,这些文件阻止了jquery日期选择器。虽然,它在代码重构之前工作,但是在代码重构之后,它停止了工作 <html> <head> <meta charset="ISO-8859-1"> <meta name="viewport" content="width=dev
<html>
<head>
<meta charset="ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="./css/bootstrap-theme.css" rel='stylesheet' type='text/css' />
<link href="./css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<link href="./css/lightbox.min.css" rel='stylesheet' type='text/css' />
<!-- <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.css" rel='stylesheet' type='text/css' /> -->
<link href="./css/chosen.css" rel='stylesheet' type='text/css' />
<link type='text/css' rel='stylesheet' href="./css/angular-bootstrap-lightbox.min.css"/>
<link href="./css/font-awesome.min.css" rel='stylesheet' type='text/css' />
<link href="./css/select2.min.css" rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="./css/flexslider.css">
<link rel="stylesheet" type="text/css" href="./css/circle.css">
<link href="./css/style.css" rel='stylesheet' type='text/css' />
<script src="./js/jquery.js"></script>
<script type="text/javascript" src="./js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="./css/select2.min.css" rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="./css/flexslider.css">
<link rel="stylesheet" type="text/css" href="./css/circle.css">
<script type="text/javascript" src="./js/formValidation.js"></script>
<link rel="stylesheet" href="./css/style.css" crossorigin="anonymous">
<link href = "https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel = "stylesheet">
<script src = "https://code.jquery.com/jquery-1.10.2.js"></script>
<script src = "https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script type="text/javascript" src="./js/DatePicker.js"></script>
<script type="text/javascript" src="./js/uploadImage.js"></script>
</head>
<body class="bodybg">
<div class="container img-fluid">
<form action="../CompleteRegistration" method="post"
id="registrationForm" onsubmit="return validateCompleteRegistrationForm()"
class="needs-validation box text-secondary" enctype='multipart/form-data' novalidate>
<h3 style="text-align: center; margin-top: 50px;">Complete Your
Form</h3>
<div style="text-align: center;"
class="mediumtxt c7 padt4 padb15 fleft mpaddl10">Take the last
step in finding your soulmate by providing your basic information.
It's simple and easy.</div>
<div class="clear-both"></div>
<div class="col-md-4 mb-3">
<label for="validationCustomUsername">Date Of Birth</label> <input
type="text" class="form-control forFont hasDatepicker" id="userDateofBirth"
autocomplete="off" name="userDateofBirth"
placeholder="dd-mm-yyyy" aria-describedby="inputGroupPrepend"
required>
<div class="invalid-feedback">Please enter Date of Birth</div>
</div>
</div>
</form>
</div>
看看这个
$document.readyfunction{
$'.datepicker'.datepicker{
格式:“dd-M-yyyy”,
};
};
在浏览器中按Ctrl+Shift+i打开inspect元素并打开networking选项卡以查看卸载的文件并确保加载了正确的文件我在网络选项卡中进行了检查,所有文件都已正确加载。/js/DatePicker.js这有什么功能?,您还包括了两个jquery,即:./js/jquery.js和https://code.jquery.com/jquery-1.10.2.js.I 在删除一个js文件后尝试过,但没有成功。js是一个js文件,其中的条件是,可以逐个删除和添加脚本,并检查哪个脚本影响DatePicker。
This is my jquery code for datepicker
$(function() {
$( "#userDateofBirth" ).datepicker({
changeMonth:true,
changeYear:true,
yearRange:"1940:currentYear",
dateFormat: "dd-mm-yy",
numberOfMonths:[1,1]
});
});