Force use of datepicker?

Force use of datepicker?

bpitonibpitoni Posts: 21Questions: 7Answers: 2

Is there a way to force the user to use the datepicker? ie - disallow typing in the input box?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,726Questions: 1Answers: 10,109 Site admin
    Answer ✓

    There isn't a built in way, but you could do something like:

    $( editor.field( 'myField' ).input() ).on( 'keydown', function ( e ) {
      e.preventDefault();
    } );
    

    Allan

  • bpitonibpitoni Posts: 21Questions: 7Answers: 2

    Excellent! Thank you!

  • allanallan Posts: 61,726Questions: 1Answers: 10,109 Site admin

    Just a quick one to say that this will be available as an option in 1.7.3. You'll be able to use keyInput: false for the field there.

    Allan

This discussion has been closed.