This is a migrated thread and some comments may be shown as answers.
Required validation not fireing client-side
1 Answer 64 Views
This is a migrated thread and some comments may be shown as answers.
Mattias
Top achievements
Rank 1
Mattias asked on 22 Feb 2013, 12:19 PM
Hi,
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))]

public
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).

Regards,
Mattias

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 26 Feb 2013, 10:29 AM
Hello,

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:

$.validator.setDefaults({
    ignore: ""
});
Kind regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
Mattias
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or