douzhulan1815 2015-09-26 14: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 2015-09-26 15: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>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部