Mysterious problem on showing the jQuery datepicker in my form
I am trying to add the jQuery Date Picker into my form, however I am having a problem on showing it. This is what I am using http://jqueryui.com/demos/datepicker/default.html and below is my code structure. For a reason when I click into the textbox, the calendar is not showing.
In header.php there is the jQuery script that I use for several purposes (tested and working) like fancybox and a loading page based on the value of a drop down list.
In single.php I include the main.php that loads a page based on the value of a drop down list (Working), in my case testpage.php that is a jQuery datepicker script that popups when you click on the textbox. But as I said开发者_JS百科, is not showing up and I don't know why.
Thank you for your solutions.
header.php
<script src="http://jqueryui.com/jquery-1.5.1.js"></script>
single.php
<?php include('main.php'); ?>
main.php
<link rel="stylesheet" href="http://jqueryui.com/themes/base/jquery.ui.all.css">
<script src="http://jqueryui.com/ui/jquery.ui.core.js"></script>
<script src="http://jqueryui.com/ui/jquery.ui.widget.js"></script>
<script src="http://jqueryui.com/ui/jquery.ui.datepicker.js"></script>
<form>
<select id="termid" class="selectfield">
<option>Choose</option>
<option value="testpage">Test Page</option>
</select>
<div id="reservationdetails" ></div>
</form>
Try loading the include file that the datepicker is in, near the end of the main file, I have had problems before when trying to load/execute javascript code in the head or somewhere in the upper-body.
I placed the js files into header.php and it is working great.
type='text/javascript'
is missing on the script tag where you tell which element is the date picker
精彩评论