Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
103
rated 0 times [  104] [ 1]  / answers: 1 / hits: 148984  / 13 Years ago, fri, september 30, 2011, 12:00:00

this is how i'm trying


<script type="text/javascript">
$(document).ready(function(){
$('#dateIn,#dateOut').click(function(e){
e.preventDefault();
});
});
</script>

but the input stills 'launching' iphone's keyboard


ps: i want to do this because i'm using datepicker plugin for date


More From » jquery

 Answers
34

By adding the attribute readonly (or readonly=readonly) to the input field you should prevent anyone typing anything in it, but still be able to launch a click event on it.



This is also usefull in non-mobile devices as you use a date/time picker


[#89846] Wednesday, September 28, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
madilynndiannac

Total Points: 191
Total Questions: 93
Total Answers: 111

Location: France
Member since Thu, Oct 15, 2020
4 Years ago
madilynndiannac questions
Sat, Aug 22, 20, 00:00, 4 Years ago
Tue, Jul 28, 20, 00:00, 4 Years ago
Thu, Jul 9, 20, 00:00, 4 Years ago
Mon, Jun 1, 20, 00:00, 4 Years ago
Mon, Jan 13, 20, 00:00, 4 Years ago
;