Date picker in JQuery and php -
i implementing calendar using jquery
. pure html form tested , it's working fine. when embed in php, it's not working , error shows when select inspect element is--> object has no method datepicker.
pure html:
<html lang="en"> <head> <title>date thing</title> <link href="jquery-ui-1.10.4.custom/css/start/jquery-ui-1.10.4.custom.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery-ui-1.10.4.custom/js/jquery-1.10.2.js"></script> <script type="text/javascript" src="jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js"></script> <script type="text/javascript" src="jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $( "#datepickerid" ).datepicker({ changeyear: true, }) }); </script> </head> <body> <p>date: <input type="text" id="datepickerid"></p> </body> </html>
php code:
<?php include('sess.php'); ?> <!doctype html> <html lang="en"> <head> <title>page title</title> <link rel="stylesheet" type="text/css" href="bootstrap.css"> <link rel="stylesheet" type="text/css" href="bootstrap.theme.css"> <link href="jquery-ui-1.10.4.custom/css/start/jquery-ui-1.10.4.custom.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery-ui-1.10.4.custom/js/jquery-1.10.2.js"></script> <script type="text/javascript" src="jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js"></script> <script type="text/javascript" src="jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $( "#datepickerid" ).datepicker({ changeyear: true, }) }); </script> </head> <body> <form name="form1" action="http://*****/******/redirect1.php" onsubmit="return validateform();" method="get"> <p>date: <input type="text" id="datepickerid"></p> </form> </body> </html>
can please let me know how make calendar work in php code?
that means aren't loading jquery ui library. however, looks loading twice. perhaps try removing <script type="text/javascript" src="jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js"></script>
. may causing conflict.
Comments
Post a Comment