- Home
- Forum
- JavaScript - EJ 2
- Validation message dissapearing
Validation message dissapearing
Hi.
Attachment: FormValidator_Behavior_135340f8.zip
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
SIGN IN To post a reply.
3 Replies
PO
Prince Oliver
Syncfusion Team
July 2, 2019 11:11 AM UTC
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 12:18 PM UTC
Hi Prince,
Attachment: Code_Snippets_cdde59ed.zip
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 01:24 PM UTC
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
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
AM Adam Mews
- Jul 1, 2019 10:38 PM UTC
- Jul 5, 2019 01:24 PM UTC