2015-09-26 86 views
0

我已經嘗試了許多datepicker插件,包括jQuery的ui datepicker和許多其他人,但迄今沒有任何與我的代碼工程....我需要添加一個datepicker這種形式的我...需要與此form..plz工作的日期選擇器help..thanksdatepicker不工作形式

<html> 
<head> 
    <link rel="stylesheet" href="css/index.css" /> 
    <link rel="stylesheet" href="css/jquery-ui-1.11.4.css" /> 
    <script src="scripts/jquery-2.1.4.min.js"></script> 
    <script src="scripts/jquery-ui-1.11.4.js"></script> 
    <script src="scripts/form.js"></script> 
</head> 

<?php 
    include "header.php"; 
    include "menu.php"; 
?> 

<body> 

<?php 
if(isset($_POST['inputcoursecode'],$_POST['inputname'],$_POST['inputid'],$_POST['inputdate'],$_POST['inputaddress'],$_POST['inputphn'],$_POST['inputemail'],$_POST['inputvouchercode'])) 
{  
    $course=$_POST['inputcoursecode']; 
    $id=$_POST['inputid']; 
    $nam=$_POST['inputname']; 
    $bday=$_POST['inputdate']; 
    $addr=$_POST['inputaddress']; 
    $phn=$_POST['inputphn']; 
    $eml=$_POST['inputemail']; 
    $voucher=$_POST['inputvouchercode']; 

    $c= mysql_connect("localhost","root",""); 
      mysql_select_db("project",$c); 
$q= mysql_query("INSERT into applications (coursecode,id,name,birthday,address,phone,email,voucher) values('".$course."','".$id."','".$nam."','".$bday."','".$addr."','".$phn."','".$eml."','".$voucher."')"); 

    if($q) 
    { 
     header("Location:success.php"); 
    } 
} 
?> 

<center> 
<div id="regibody"> 

    <h2><u>Course Ragistration form</u></h2> 


    <form id="regiform" name="f1" action="form.php" method="POST" enctype="multipart/form-data" onsubmit="return confirm('Do you really want to submit the form?');"> 

     <table class="regitable"> 

      <tr><td>Course Code:</td>  <td><input type="text" name="inputcoursecode" onkeypress="return isAlpha()" required></td></tr> 

      <tr><td>Name:</td>    <td><input type="text" name="inputname" onkeypress="return isAlpha()" required></td></tr> 

      <tr><td>ID:</td>    <td><input type="text" name="inputid" onkeypress="return isNumberid()" required></td></tr> 

      <tr><td>Date of Birth:</td>  <td><input type="text" id="inputdate" name="inputdate" required /></td></tr> 

      <tr><td>Address:</td>   <td><textarea name="inputaddress" rows="10" cols=40" required></textarea></td></tr> 

      <tr><td>Phone No:</td>   <td><input type="text" name="inputphn" onkeypress="return isNumberph()" required></td></tr> 

      <tr><td>eMail:</td>    <td><input type="email" name="inputemail" required></td></tr> 

      <tr><td>Voucher Code:</td>  <td><input type="text" name="inputvouchercode" onkeypress="return isNumbervc()" required></td></tr> 

     </table> 
     <br /> 
     <input type="submit" value="Submit"> 

    </form> 

</div>  
</center> 

<?php 
    include "footer.php"; 
?> 

</body> 
</html> 
+0

裏面是什麼東西在form.js? –

+0

一些驗證函數,如isAlpha() –

+1

當你加載dom時,你在哪裏初始化日期選擇器輸入? –

回答

0
<head> 
    <link rel="stylesheet" href="css/index.css" /> 
    <link rel="stylesheet" href="css/jquery-ui-1.11.4.css" /> 
    <script src="scripts/jquery-2.1.4.min.js"></script> 
    <script src="scripts/jquery-ui-1.11.4.js"></script> 
    <script src="scripts/form.js"></script> 
    <script> 
    $(function() { 
     $("#inputdate").datepicker(); 
    }); 
    </script> 
</head> 
+0

幾次嘗試過這一次....不能使它工作 –

+0

把你的JavaScript放在身體的最底部,看看它是否工作。 –

+0

工作...... !!! ...非常感謝...你能解釋爲什麼它沒有;以前工作? –