jQuery UI Widgets › Forums › Editors › DateTimeInput › Can datetimeinput be only selected, not editable by keyboard?
Tagged: blur, daterange, datetimeinput, focus, jqxdatetimeinput
This topic contains 3 replies, has 4 voices, and was last updated by selva 7 years, 9 months ago.
-
Author
-
Hi,
I need a widget which can only be edited by selecting date. But I didn’t find any option to disable keyboard editing function in datetimeinput.
Thanks!
Hello yuanru,
Here is an example which shows how to stop keyboard editing.
<!DOCTYPE html> <html lang="en"> <head> <title></title> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdatetimeinput.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxtooltip.js"></script> <script type="text/javascript" src="../../jqwidgets/globalization/globalize.js"></script> </head> <body> <div id='content'> <script type="text/javascript"> $(document).ready(function () { // Create a jqxDateTimeInput $("#jqxWidget").jqxDateTimeInput({ width: '250px', height: '25px' }); $("#inputjqxWidget").focus(function () { $(this).blur(); }); }); </script> <div id='jqxWidget'> </div> </div> </body> </html>
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/Hi yuanru,
Another solution is to set readonly to true – http://jsfiddle.net/jqwidgets/yv5gR/
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter Stoev,
I have two dateTimeInput elements like appointmentStartTime and appointmentEndTime.
My scenario is restrict appointmentEndTime is not less than start time and also not greater than 8 hrs in a same day. And by default user after entering the appointment start time, then appointment End time is auto calculate to 1 hr from the start time. How can i achieve this. -
AuthorPosts
You must be logged in to reply to this topic.