0

我的日期选择器和时间选择器没有显示在“输入日期:”和“输入时间:”字段旁边:http: //heightsdental.com/RequestAppt.php。代码中有 php include 语句,当它们不存在时:http://evamagnus.com/RequestAppt.php,将显示日期和时间选择器。

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

<script src="js/modernizr-2.5.3.min.js"></script>

<script type="text/javascript" src="js/jquery.ptTimeSelect.js"></script>

<script src="js/dimensions.js" type="text/javascript"></script>

    <script src="js/jquery.ui.core.js">
     </script>
    <script src="js/jquery.ui.datepicker.js">
    </script>

<?php
include "Banner.html";
include "header.html"
?>

<div id="form">
<div id="contain">

    <form action="http://www1.budgethostingweb.com/cgi-bin/hosting/user_formmail.cgi" method="post">
    <input type="hidden" name="account" value="dentist">
    <input type="hidden" name="cata" value="accounts">
    <input type="hidden" name="redirect" value="index.php" />

      <table class="form_demo">
        <tr>
          <td>
            <label for="name">
              Name
            </label>
          </td>
          <td>
            <input class="input_full" type="text" id="name" name="name" required="required" />
          </td>
        </tr>
        <tr>
           <td><label for="email">
              Email
            </label>
          </td>
          <td>
            <input class="input_full" type="email" id="email" name="email" required="required" />
          </td>
        </tr>
        <tr>
          <td>
            <label for="cc">
              <abbr title="Courtesy Copy">CC</abbr>
            </label>
          </td>
          <td>
            <input type="checkbox" id="cc" name="cc" value="1" />
            <label for="cc">
              Send me a copy of this email
            </label>
          </td>
        </tr>
        <tr>
          <td>
            <label for="tel">
              Phone
            </label>
          </td>
          <td>
            <input class="input_full" type="tel" id="tel" name="tel" required="required" />
          </td>
        </tr>
        <tr>
          <td><label for="priority_normal">
              Priority
            </label>
          </td>
          <td>
            <input type="radio" name="priority" id="priority_urgent" value="Urgent">
            <label for="priority_urgent">
              Urgent
            </label>
            &nbsp;
            &nbsp;
            <input type="radio" name="priority" id="priority_normal" value="Normal" checked="checked">
            <label for="priority_normal">
              Normal
            </label>
            &nbsp;
            &nbsp;
        </td>
        </tr>
        <tr>
        <td>
            <label for="date">Enter a date:</label>
        </td>   
        <td>
            <input class="input_xlarge" type="text" id="date" name="date" required="required" />    

    <script>
      (function($){
         var pickerOpts = {
            minDate: new Date(),
            maxDate: "+3m,",
            showButtonPanel: true,
            showOn: "button",

            buttonImage: "images/cal.png",
            };
    $("#date").datepicker(pickerOpts);
      })(jQuery);
    </script>
    </td></tr>
    <tr><td>Enter a time: </td>
    <td><input id="time1" name="s2Time1" />

    <script type="text/javascript">
    $('#time1').ptTimeSelect({ popupImage: 'Select Time' });
    </script>
    </td>
    </tr>

        <tr>
          <td>
            <label for="description">
              Reason for<br />
              appointment
            </label>
          </td>
          <td>
            <textarea id="description" name="description" rows="3" required="required"></textarea>
          </td>
        </tr>

        <tr><td colspan="2">To prevent automated spam posts, <br>please type in the access code
displayed: <p><img alt="Access code"
src="http://www1.budgethostingweb.com/cgi-bin/captcha/imagegen.cgi?x-factor=1"/></p></td></tr>
        <tr><td>Access Code:</td> <td><input class="medium" name="access" type="text"></td>
        </tr>
      </table>
      <hr />
      <p class="clearfix">
        <input type="submit" value="Submit" class="float_left" />
        <input type="reset" value="Reset" class="float_right">
      </p>

    </form>
4

3 回答 3

2

以下路径中缺少文件:

http://heightsdental.com/js/jquery.ui.core.js

http://heightsdental.com/js/jquery.ui.datepicker.js

于 2012-08-01T13:47:33.467 回答
1

您的 jQuery UI 脚本包含失败。

于 2012-08-01T13:44:05.520 回答
1

快速浏览一下 chrome 的开发工具会发现:

Failed to load resource: the server responded with a status of 404 (Not Found) http://heightsdental.com/js/jquery.ui.core.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://heightsdental.com/js/jquery.ui.datepicker.js
Uncaught TypeError: Object [object Object] has no method 'datepicker' RequestAppt.php:159
Uncaught TypeError: Property '$' of object [object Window] is not a function RequestAppt.php:167

含义:您的 JavaScript 包含指向不存在的文件的点。

查看您的 js 子目录显示:它们确实不存在。

(顺便说一句,允许索引,禁用目录列表很糟糕)

于 2012-08-01T13:49:46.987 回答