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
More Related Contents:
- Run javascript function when user finishes typing instead of on key up?
- Binding arrow keys in JS/jQuery
- $(document).click() not working correctly on iPhone. jquery [duplicate]
- Detecting touch screen devices with Javascript
- Simulate Keypress With jQuery
- Mobile Safari: Javascript focus() method on inputfield only works with click?
- Handling key-press events (F1-F12) using JavaScript and jQuery, cross-browser
- How to check browser for touchstart support using JS/jQuery?
- Preventing default context menu on longpress / longclick in mobile Safari (iPad / iPhone)
- Manually triggering the iPhone/iPad/iPod keyboard from JavaScript
- How to know if .keyup() is a character key (jQuery)
- How can I avoid autorepeated keydown events in JavaScript?
- iphone/ipad triggering unexpected resize events
- Why is my javascript not working
- event.preventDefault() vs. return false
- Inserting a text where cursor is using Javascript/jquery
- JavaScript: filter() for Objects
- jQuery.parseJSON throws “Invalid JSON” error due to escaped single quote in JSON
- jQuery: load txt file and insert into div
- How to copy text from a div to clipboard
- How to send data in request body with a GET when using jQuery $.ajax()
- How can I detect with JavaScript/jQuery if the user is currently active on the page?
- Setting CSS value limits of the window scrolling animation
- Dynamically adding cases to a switch
- How can I make a button redirect my page to another page? [duplicate]
- jQuery .on(‘change’, function() {} not triggering for dynamically created inputs
- jQuery get html of container including the container itself
- Change placeholder text
- Take User Back to Where They Scrolled to on previous page when clicking Browser Back Button
- Automatically resize jQuery UI dialog to the width of the content loaded by ajax