search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Control event text (numeric or alphanumeric)

Asked by Anonymous
4 years ago.

Hi,
Is it possible to prevent certain characters in the event text. I want the event text to contain all numeric values.
Thanks

Answer posted by Dan Letecky [DayPilot]
4 years ago.

The latest sandbox build (2020.4.4729) lets now includes an experimental onAfterEventEditRender event handler that lets you access the editing <textarea> element using args.element. You can use it to add custom event handler that will filter out the forbidden characters.

Comment posted by Anonymous
4 years ago.

Thank you. Now I want to change the style of the embedded textarea. I added the following CSS style both in the global style.css and in CSS file of the component that contains the scheduler.

.scheduler_time_reporting_board-place-editor {
border: 1px solid red !important;
}

onAfterEventEditRender: (args) => {
args.element.classList.add('scheduler_time_reporting_board-place-editor');
},

However it seems not work. Am I doing something wrong?

Comment posted by Dan Letecky [DayPilot]
4 years ago.

Most browsers define an outline style that highlights the active input element. The border gets hidden by the outline. You need to override the outline style or hide the outline:

.scheduler_time_reporting_board-place-editor {
  border: 1px solid red !important;
  outline: none;
}
Comment posted by Anonymous
4 years ago.

Perfect! Thanks a lot!

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.