diff --git a/calendar/js/CalendarOwner.ts b/calendar/js/CalendarOwner.ts index 77d123eae5..16e1a21db9 100644 --- a/calendar/js/CalendarOwner.ts +++ b/calendar/js/CalendarOwner.ts @@ -38,9 +38,6 @@ export class CalendarOwner extends Et2Select super(...args); this.searchUrl = "calendar_owner_etemplate_widget::ajax_search"; this.multiple = true; - - // Any free entries must be email addresses - this.defaultValidators.push(new IsEmail()); } /** @@ -91,6 +88,22 @@ export class CalendarOwner extends Et2Select }, this, true, this).sendRequest(); } } + + /** + * Check if a free entry value is acceptable. + * We only check the free entry, since value can be mixed. + * + * @param text + * @returns {boolean} + */ + public validateFreeEntry(text) : boolean + { + let validators = [...this.validators, new IsEmail()]; + let result = validators.filter(v => + v.execute(text, v.param, {node: this}), + ); + return result.length == 0; + } } customElements.define("calendar-owner", CalendarOwner); \ No newline at end of file