douzhulan1815
douzhulan1815
2015-09-26 22:57
浏览 26

datepicker不在表单中工作

i've tried many datepicker plugins including the jQuery ui datepicker and many others but so far nothing works with my code....i need to add a datepicker to this form of mine...need a datepicker that works with this form..plz help..thanks

<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>
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongmeirang4679
    dongmeirang4679 2015-09-26 23:30
    已采纳
    <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>
    
    点赞 评论

相关推荐