how to make editor date calendar only selectable.

how to make editor date calendar only selectable.

GE PowerGE Power Posts: 10Questions: 2Answers: 0

i want to disable the manual entry for date field. user should only select date from calendar for update. Please help.

Replies

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin

    The field().disable() method can be used to disable user input.

    Allan

  • GE PowerGE Power Posts: 10Questions: 2Answers: 0

    field().disable() API will disable the field and it will not be editable manually or selectable from calendar. I am looking for option where user should be restricted from manually enter in text box, only from calendar date should be selected

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Are you using the datetime field type ?

  • GE PowerGE Power Posts: 10Questions: 2Answers: 0

    yes, i am using datetime type

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    I was guessing that Editor's datetime input field would have this capability, but apparently it doesn't. Seems like a reasonable new feature request.

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin

    Thanks for the clarification of what you are looking for.

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

    should do it.

    Allan

This discussion has been closed.