We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

e-success on dropdown list

Hi Team,

How I can set e-success/e-warning/e-error on dropdown list?
I need this when I validate form.

Regards

1 Reply

CI Christopher Issac Sunder K Syncfusion Team July 15, 2019 02:21 PM UTC

Hello Marko, 

Greetings from Syncfusion support. 

To set the validation class names in dropdownlist, you can manually add the class names into the inner element of the dropdown. Here is the code snippet for your reference. 

//on button click 
public onClick(args: any): void { 
    let listElt: Element = this.listObj.element.querySelector(".e-input-group"); 
    listElt.classList.remove('e-success') 
    listElt.classList.remove('e-warning'); 
    listElt.classList.remove('e-error'); 
 
    if (args.target.id == 'btn1') { 
        listElt.classList.add('e-success') 
    } 
    else if (args.target.id == 'btn2') { 
        listElt.classList.add('e-warning'); 
    } 
    else if (args.target.id == 'btn3') { 
        listElt.classList.add('e-error'); 
    } 
} 

Please refer to the below sample, 

Please get back to us if you require any further assistance. 

Thanks,
Christo 


Loader.
Live Chat Icon For mobile
Up arrow icon