PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Prevent keyboard popup on datepicker for mobile devices

  1. Ketiga
    Member

    Hello,

    I am trying to prevent the virtual keyboard from popping up on mobile devices when using the datepicker field in gravity forms.

    Tried a couple of Jquery suggestions I found on the internet, but they didn't work.

    Please assist...

    Posted 11 years ago on Saturday November 10, 2012 | Permalink
  2. Hello, I had this same problem a couple months ago. My solution was to use JS to make the datepicker 'Read Only'. You can see an example on my page here: https://hookahi.com/guides/hucks-charters/ . This means that users must select the date on the calendar popup only, and the keyboard won't on mobile devices because the user can't input text.

    Here is the code:

    <script type="text/javascript">
        jQuery(function() {
            jQuery( ".datepicker" ).datepicker({ }).attr('readonly','readonly');
        });
        </script>

    Hope this helps :) let me know if you have any questions

    Posted 11 years ago on Monday November 12, 2012 | Permalink
  3. Ketiga
    Member

    Thanks for the reply!

    I managed to get it to work using a hidden html field with the datepicker attached to it and copying the entered value to a field with the readonly property to show the date on screen, but your solution is much more efficient.

    I will try it and let you know, thanks again.

    Posted 11 years ago on Monday November 12, 2012 | Permalink
  4. No problem, keep me posted!

    Posted 11 years ago on Monday November 12, 2012 | Permalink