Required validation not fireing client-side

2 posts, 0 answers
  1. Mattias
    Mattias avatar
    263 posts
    Member since:
    Aug 2012

    Posted 22 Feb 2013 Link to this post

    I have a box:
    @(Html.Kendo().NumericTextBoxFor(m => m.FilterParticipants).Format("n0").Min(1).Decimals(0))
    with a required attribute:
    [Required(ErrorMessageResourceName = "ValidationRequired", ErrorMessageResourceType = typeof(Resources.Global))]
    //[Min(1, ErrorMessageResourceName = "ValidationRequired", ErrorMessageResourceType = typeof(Resources.Global))]

    int FilterParticipants { get; set; }
    and if I clear the box I can still submit the form.
    But: I also have a datepicker in the form and if I clear that control and tries to submit, then the validation fires (on both controls).


  2. Daniel
    Daniel avatar
    2110 posts

    Posted 26 Feb 2013 Link to this post


    A problem with the NumericTextBox validation might occur if you are using the jQuery validation because by default it skips hidden inputs. If that is the case, you should override the validator default settings:

        ignore: ""
    Kind regards,
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET AJAX banner
Back to Top