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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Asp.net Core validation tag helper is ignored for the ej-drop-down-list

Thread ID:

Created:

Updated:

Platform:

Replies:

128816 Feb 10,2017 02:40 PM UTC Feb 11,2017 11:44 AM UTC ASP.NET Core 1
loading
Tags: DropDownList
dsapo
Asked On February 10, 2017 02:40 PM UTC

Hi Support:

I added the following script, but the validation tag helper is ibeing gnored for the required property:

  <ej-drop-down-list id="CityID" watermark-text="Select" datasource="@Model.Cities">
           <e-drop-down-list-fields text="Name" value="ID" />
  </ej-drop-down-list>
  <span asp-validation-for="CityID" class="text-danger" />


All the other input controls works fine, but this is the only Syncfusion control in the page in which the validation is not triggered.

What could I be missing here ?

Thanks in advanced

David


Prince Oliver [Syncfusion]
Replied On February 11, 2017 11:44 AM UTC

Hi David, 

Thanks for contacting Syncfusion support. 

In JQuery validation plugin by default hidden inputs are excluded from being validated on form post. Our Dropdownlist maintains the value in the hidden input and hence it is getting excluded from validation. To overcome this issue, you need to clear the defaults in the validator. Refer to the following code snippet. 

<script> 
    $.validator.setDefaults({ 
        ignore: [],// To include hidden input validation. 
        errorClass: 'e-validation-error', // To get the error message on jquery validation 
        errorPlacement: function (error, element) { 
            $(error).insertAfter(element.closest(".e-widget"));// To place the error message 
        } 
    }); 
</script> 

We have attached a sample for your convenience. Refer to the following link for the sample: 

Regards, 
Prince 


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.

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

;