You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a request about REQUIRED, I wanna know how we can check js-choice If not select any value then give an error message and after selection error message hides on submit button.
Thanks
The text was updated successfully, but these errors were encountered:
constelement=document.getElementById('select')newChoices(element,{callbackOnInit(){constinput=element.closest('.choices').querySelector('input')// trigger by a form o by using element.checkValidityelement.addEventListener('invalid',()=>input.setCustomValidity(element.validationMessage))element.addEventListener('change',()=>input.setCustomValidity(element.validationMessage))},})
Note: By default, the select element is hidden with display: none, that's why the required message is not displayed
Hi Sir,
I hope you are doing well.
I have a request about REQUIRED, I wanna know how we can check js-choice If not select any value then give an error message and after selection error message hides on submit button.
Thanks
The text was updated successfully, but these errors were encountered: