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
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

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

Syncfusion Feedback

How to resolve validation message appears even after value change on the drop down?

Platform: jQuery |
Control: ejGrid |
Published Date: August 21, 2018 |
Last Revised Date: August 21, 2018

This KB showcase the example to disappear the Validation Message shown even after the value is changed in the dropdown list using valid method.

Solution:

In dropdown list, we have maintained the hidden input element. The jQuery validation is not works for hidden element. Due to this the default validation is not working in dropdown list to overcome this, use the valid method in the dropdown change event.

Step 1: Render the grid control.

HTML

 

JS

 

MVC

 

 

ASP

 

 

.Net core

 

 

Angular

 

 

Step 2: In the actionComplete event while adding the records, we have removed the validation message using valid method in the dropdown change event.

 

Figure 1: Before using valid method, Validation Message is shown even after the value is changed in the drop down.

 

Figure 2: After using valid method, Validation Message is disappeared when value is changed in dropdown.

 

 

 

ADD COMMENT
You must log in to leave a comment
Comments
Terrance Smith
Jul 16, 2020

In the code at step 2 line # 7

$("#GridEmployeeID ").ejDropDownList({ 
                          change: function (args) { 
                                 this.element.valid(); // validation message removed once value selected. 
                          } 
                    });

where is

#GridEmployeeID

coming from ? Is that a typo or a naming convention? I don't see it declared anywhere else.

Is it a name determined by attributes already declared?

For example :{GridId}+{FieldName}?

Reply
Manivannan Padmanaban [Syncfusion]
Jul 17, 2020

Hi Terrance,

Greetings from Syncfusion Support.

As you mentioned, “GridEmployeeID” is GridID + FieldName. In the Knowledge Base help documentation example, we have defined the grid ID as “Grid” and the dropdown filed name is “EmployeeID”. So the dropdown element ID will be “GridEmployeeID”. As like same, you can use your grid ID and dropdown field name to get the dropdown element.

Kindly get back to us, if you need further assistance. We will be happy to assist you.

Regards, Manivannan Padmanaban

Please sign in to access our KB

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

Up arrow icon

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