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 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>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么