我在jQuery中创建日期范围选择器并将其绑定到输入文本字段。jQuery日期选择器绑定到输入文本字段错误
的代码是这样的:
<!DOCTYPE html>
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$("#datepicker").datepicker();
});
</script>
</head>
<body style="font-size:62.5%;">
<form action="sample.php" method="post">
Start Date: <input type="text" name="startdate" id="datepicker"/>
End Date: <input type="text" name="enddate" id="datepicker"/>
<input type="submit" />
</form>
</body>
</html>
数据似乎是工作的开始日期输入文本字段。当我选择起始日期字段,显示的日历:
但是当我点击结束日期输入文本字段,永远不会出现在日历。我需要通过使用该日历选择日期开始和结束。
我的代码中一定是错的。谁能告诉我?
谢谢!
非常感谢您的帮助。 – 2012-03-19 08:11:28