Hi guys, I have a multiselect which allows custom entries. My use case is the user can enter an email address or select one from a predefined list. What I'd like to achieve is when the user enters a custom value, it is automatically checked against a regex to determine validity and removed if it is not. First off, I can't seem to get the
customValueSelection
event to fire. I can get select to respond but then I'm struggling with that removal step.
In the code below I'm just trying to remove anything the user enters
<ejs-multiselect id="txtTo" allowCustomValue="true" select="tochange" placeholder="To" floatLabelType="Auto" delimiterChar=";">
<e-multiselect-fields text="EMAIL" value="EMAIL"></e-multiselect-fields>
</ejs-multiselect>
<script>
function tochange(args) {
console.log(args);
$("#txtTo")[0].ej2_instances[0].removeValue(args.itemData.EMAIL);
}
<script>
Can someone please advise what I'm doing wrong?