0

I have built a Form with autocomplete control. After selecting an entry in autocomplete the values of two hidden fields are being set with ("#fieldName").val() method like

$("#managerID").val(data.Id);

When the form is posted the values of the hidden fields are not in the model. The value entered in the autocomplete field is.

When I change the fields to visible textboxes I get the same effect.

Although when I enter data in the textbox manually the value is getting posted to the controller.

What is hindering the values set with val() method from being posted to the controller model?

Thanks for help

0

1 Answer 1

1

I'm using Telerik Scheduler with a custom EditTemplate with the update mechanism as described. I got reply from Telerik that Scheduler uses MVVM and changes in controls done with JQuery or JavaScript are not reflected in the Model by default. To achieve this I have to call

$("#idOfTheField").trigger("change");

after every change of the value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.