Hi Support:
I need to include client side validation to my form that has several dropdownlist control in asp.net core.
My problem is that the validation works but the error message is not being displayed.
I tested your sample:
https://www.syncfusion.com/forums/128816/asp-net-core-validation-tag-helper-is-ignored-for-the-ej-drop-down-list
and works fine, but inside my web application is not working. In my application I am using bootstrap, no idea if this could be creating this issue. The strange thing is that no errors in the console.log
This is definition of a control:
<ej-drop-down-list id="Service" name="Service" width="100%" popup-height="100px" show-rounded-corner="true"
datasource="@Model.Services" watermark-text="Select"
validation-rules='new Dictionary<string, object>() { { "required",true} }'
validation-message='new Dictionary<string, object>() { { "required","value required"} }' >
<e-drop-down-list-fields text="Name" value="ID" />
</ej-drop-down-list>
<script type="text/javascript">
$.validator.setDefaults({
ignore: [], // To include hidden input validation.
errorClass: 'input-validation-error', // to get the error message on jquery validation
errorPlacement: function (error, element) {
$(error).insertAfter(element.closest(".e-widget"));
}
});
</script>
This is the rendered view of the control:
<input type="hidden" id="Service" class="e-dropdownlist e-js input-validation-error" tabindex="" value="" role="combobox" aria-expanded="false" aria-autocomplete="list" aria-haspopup="true" aria-owns="Service_popup" style="display: none;" name="Service" aria-required="true" aria-describedby="Service-error">
What could I be missing here that is causing that the error message is not being displayed.
Thanks in advance.
David