https://www.dotnetcurry.com/jquery/1209/jqueryui-datepicker-tips-tricks
Disabling Mobile Keyboard Input on Datepicker Fields
<script type=
"text/javascript"
>
jQuery(
function
() {
jQuery(
".datepicker"
).datepicker({ }).attr(
'readonly'
,
'readonly'
);
});
</script>
CR:
ตัวอย่าง
href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js">
</script> <!--ทำเป็น Mobile--> <script src="
https://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js">
</script> <link rel="stylesheet"
href="https://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css"> <script> $( function() { $( "#datepicker1" ).datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, dateFormat: 'dd-mm-yy' }); $( "#datepicker2" ).datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, dateFormat: 'dd-mm-yy' }); }); </script> <!--//for disable soft keyboard on mobile--> <script type="text/javascript"> jQuery(function() { //for disable soft keyboard on mobile jQuery( "#datepicker1" ).datepicker({ }).attr('readonly','readonly'); jQuery( "#datepicker2" ).datepicker({ }).attr('readonly','readonly'); }); </script>
</head>
<body>
<form action="leave_sql.php" method="post">
วันที่เริ่มต้น : <input type="text" size="10" name="start_date" id="datepicker1" />
วันที่สิ้นสุด : <input type="text" size="10" name="end_date" id="datepicker2"/>
<input type="submit" data-inline="true" value=" ลา " data-theme="b">
</form>
</body>
</html>
ไม่มีความคิดเห็น:
แสดงความคิดเห็น