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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

e-success on dropdown list

Thread ID:

Created:

Updated:

Platform:

Replies:

145893 Jul 12,2019 07:57 AM UTC Jul 15,2019 02:21 PM UTC Angular - EJ 2 1
loading
Tags: DropDownList
Marko
Asked On July 12, 2019 07:57 AM UTC

Hi Team,

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

Regards

Christopher Issac Sunder K [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon