1
我有這個問題。我正在嘗試創建一個表單頁面,它將使用while循環顯示數據列表,並且每個表單都有輸入字段選項以選擇將全部提交的日期。到目前爲止,我已經顯示了大約4個字段,但datepicker只適用於第一個。其餘的只是空的文本框。在一個while循環中的日期選擇器
這是我的代碼:
$query = "SELECT * FROM application WHERE Shortlist_status = 1 ORDER BY Candidate_id ASC";
$result = mysqli_query($link, $query) or die(mysqli_error($link));
<html>
<head>
<link href="stylesheet/style.css" rel="stylesheet"/>
<script src="script/jquery-1.10.2.min.js"></script>
<script src="script/jquery-ui-1.10.3.custom.min.js"></script>
<link rel="stylesheet" href="stylesheet/jquery-ui-1.10.3.custom.min.css">
<script>
$(function() {
$("#datepicker").datepicker();
});
</script>
</head>
<title>
Arrange interview
</title>
<body>
while ($row = mysqli_fetch_array($result)) {
(Some other input data)
<input type="text" id="datepicker" name="date"/>
}