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

Validation message dissapearing

Hi.

I have an listbox (non-syncfusion component) that stores some data. This data is then stored in a hidden multiselect component to be send to the controllers. This two components are located inside a tab in a Grid Edit Template Dialog.

When there is no data inside the listbox the validator shows up the message (see Fig1). But when i add one another and then remove it, the validation message does not appears (see Fig2). The validation is based in the multiselect component with their values.

I'm missing something here?

Obs: The images with the codes and behaviors are in the file


Attachment: FormValidator_Behavior_135340f8.zip

3 Replies

PO Prince Oliver Syncfusion Team July 2, 2019 03:11 AM

Hello Adam, 

Thank you for contacting us. 

We have checked you reported scenario in our end. We need more information to replicate the issue in our end. Kindly share us the complete code snippet of the Grid. This will help us provide a prompt solution. 

Regards, 
Prince 



AM Adam Mews July 2, 2019 04:18 AM

Hi Prince,

Thanks for your response.

The grid and the dialog template code snippet are inside the zip file. I shaed the whole code if you want some other part

Let me know if you gonna need something else.

Best,
Adam





Attachment: Code_Snippets_cdde59ed.zip


VK Vinoth Kumar Sundara Moorthy Syncfusion Team July 5, 2019 05:24 AM

Hi Adam, 
 
Good day to you. 
 
We have checked your code example with provided screenshot and we suspect that you have changed the value for the EJ2 MultiSelect dynamically. But, our MultiSelect validated the value within the form in the focus out action which caused this issue. So, we suggest you validate the MultiSelect component in the change event as like in the below code example. 
 
// initialize MultiSelect component 
var listObj = new ej.dropdowns.MultiSelect({ 
    // set the placeholder to MultiSelect input element 
    placeholder: 'Favorite Sports', 
    // set the type of mode for how to visualized the selected items in input element. 
    mode: 'CheckBox', 
    change: onChange 
}); 
 
listObj.appendTo('#default'); 
 
var options = { 
    rules: { 
        default: { required: true } 
    } 
}; 
 
// Initialize the FormValidator. 
var formObj = new ej.inputs.FormValidator('#formId', options); 
 
function onChange(args) { 
    formObj.validate("default"); // To validate the Multiselect component 
} 
 
For your convenience, we have prepared the simple for MultiSelect with form validation and same can be found from below link, 
 
 
Could you please check the above sample and get back to us with more details if you still face the issue or need any further assistance on this? 
 
Regards, 
Vinoth Kumar S 


Loader.
Live Chat Icon For mobile
Up arrow icon