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
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

validation message appears even after value change using ejDropDownList

Thread ID:

Created:

Updated:

Platform:

Replies:

147022 Aug 28,2019 09:01 AM UTC Aug 29,2019 06:57 AM UTC jQuery 1
loading
Tags: ejDropDownList
Ali Ossaily
Asked On August 28, 2019 09:01 AM UTC

Hello Syncfusion Support , 

I Have this dropdown list which displays gender for the user to select one , if the user didn't select gender and submit the form required filed message should appear .

but this error message appears inside the dropdown . and if I select a gender this this message does not disappear . So , 

 how I can hide this error message after i select a gender ?

and how to make this error message appears outside the dropdown list . (under the dropdown)?

Thanks in advanced.

 $('#Gender').ejDropDownList({
            dataSource: self.Gender,
            fields: { text: "name", value: "id" },
            select: function (args) {
                console.log("Value is " + args.value);
                self.GenderId(args.value);
            },
            validationRules: {
                required: true
            },
            validationMessage: {
                required: "Required field"
            },
            watermarkText: "Gender",
            width: "100%"
        });

Ashokkumar Balasubramanian [Syncfusion]
Replied On August 29, 2019 06:57 AM UTC

Hi Ali Ossaily, 
 
Good day to you. 
 
For this scenario, you can bind the change event and validate the corresponding Dropdown List in your application. Please refer the below code block. 
 
      $('#name').ejDropDownList({ 
            dataSource: items, 
            fields: { 
                text: "name", 
                value: "id" 
            } 
            , 
            watermarkText: "Gender", 
            validationRules: { 
                required: true 
            }, 
            validationMessage: { 
                required: "Required field" 
            }, 
            change: "ddlValid" 
        }); 
           function ddlValid() { 
                 this.element.valid(); 
           } 
 
 
To know more details about Dropdown List validation, please refer the below help document. 
 
 
Could you please check the provided information’s and get back to us, if you require any further assistance on this? 
 
Regards, 
Ashokkumar B. 


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