开发者

jquery datepicker with codeigniter issues

I'm trying to write a sign up form using CodeIgniter and want to use the jquery datepicker for DOB, but the following isn't worki开发者_运维百科ng. This is the entire page:

<!DOCTYPE HTML>
<html>
<head>

    <link rel="stylesheet" href="http://localhost/cc/css/style.css" type="text/css" media="screen" charset="utf-8">
    <link rel="stylesheet" href="http://localhost/cc/jquery/css/dot-luv/jquery-ui-1.8.16.custom.css" type="text/css" media="screen" charset="utf-8">
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script>
    <script src="http://localhost/cc/jquery/js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
    <title>CC - Card Central</title>
</head>

<body>
    <script>
        $(function() {
            $( ".datepicker" ).datepicker();
        });
    </script>

    <fieldset>
        <legend>Create a new account!</legend>
            <fieldset>
                <legend>Personal Information</legend>
                <form action="http://localhost/cc/index.php/account/create_account" method="post" accept-charset="utf-8">
                    <input type="text" name="firstname" value="" placeholder="First Name" />
                    <input type="text" name="middlename" value="" placeholder="Middle Name" />
                    <input type="text" name="lastname" value="" placeholder="Last Name" />
                    <input type="text" name="dob" value="" placeholder="Date of Birth" class="datepicker" />
            </fieldset>
            <fieldset>
                <legend>Account Information</legend>
                    <input type="text" name="username" value="" placeholder="Username" />
                    <input type="text" name="password" value="" placeholder="Password" />
                    <input type="text" name="passwordconfirm" value="" placeholder="Password Confirm" />
                    <input type="submit" name="submit" value="Done!"  />        
            </fieldset>
        </fieldset>
    </body>
</html>


You've forgotten to include the jQuery library :-)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>

Put that before the script tag that references jQuery UI and you should be good to go

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜