I have a viewModel with a property for a select. The property is placed inside a ko.validatedObservable({}). I am separating different Views with different ko.validatedObservable() sections. My inputs are validating fine except that the select is validating from page load even though in init() I have messagesOnModified: true (because I dont want to show error messages when first loading the page). The first option has value="". I checked the markup and the data-orig-title="REQUIRED" is set while the other input controls has this attribute set to "" as it should be
Could someone point out why the select behaves differently? I should also add that I am generating the Select with razor @Html.DropDownListFor(x=>x.dest_provincia, Model.Items, new { data_bind="dest_provincia"})
This is a sample of the validation
(on the viewModel)
self.dest_provincia = ko.observable().extend({ required: { message: "REQUIRED"} });
and this is placed inside:
self.userValidation = ko.validatedObservable({
rem_provincia: this.rem_provincia
)};
I have noticed that the validation is happening on the select because a change event is being triggered, but I don't know what is making it..? Update: I tried creating the select by razor, by looping on $.each in an ajax call and by filling an observableArray in knoackout. In any case the change event is trigger on page load...!?