princeofpersia Posted November 27, 2010 Share Posted November 27, 2010 Hi guys I have a text box which uses datetimepicker in jquery and I have checked all the links, it shows the date time in text field but when i click inside the box it wont open the calendar, I do understand that is not a php question but I need to embed this to a pho code, so can u please help me to figure out how i should get it runing in a way that when i click on a text field in opens the calendar? thanks in advance <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>jQuery UI Example Page</title> <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.6.custom.css" rel="stylesheet" /> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.6.custom.min.js"></script> <script type="text/javascript" src="js/timepicker.js"> </script> <script type="text/javascript"> $(function() { $(?#datetime?).datepicker({ duration: ?, showTime: true, constrainInput: false, stepMinutes: 1, stepHours: 1, altTimeField: ", time24h: false }); }); </script> </head> <body> <input type="text" name="datetime" id="datetime" value="01.06.2009 00:00"> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/219990-jquery-date-time-picker-in-php/ Share on other sites More sharing options...
kenrbnsn Posted November 27, 2010 Share Posted November 27, 2010 Since this is a Javascript question, I'm moving it from the PHP area to the Javascript area. Once you get an answer there you can ask your PHP questions in the PHP area. Ken Quote Link to comment https://forums.phpfreaks.com/topic/219990-jquery-date-time-picker-in-php/#findComment-1140305 Share on other sites More sharing options...
ohdang888 Posted November 28, 2010 Share Posted November 28, 2010 Change this: $(function() { $(?#datetime?).datepicker({ duration: ?, showTime: true, constrainInput: false, stepMinutes: 1, stepHours: 1, altTimeField: ", time24h: false }); }); to this: $(function() { $("#datetime").datepicker({ showTime: true, constrainInput: false, stepMinutes: 1, stepHours: 1, time24h: false }); }); Quote Link to comment https://forums.phpfreaks.com/topic/219990-jquery-date-time-picker-in-php/#findComment-1140694 Share on other sites More sharing options...
princeofpersia Posted November 29, 2010 Author Share Posted November 29, 2010 thanks, it worked Quote Link to comment https://forums.phpfreaks.com/topic/219990-jquery-date-time-picker-in-php/#findComment-1140826 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.