开发者

Telerik MVC controls - serialize NumericTextBox in js

开发者 https://www.devze.com 2023-02-11 18:04 出处:网络
On my form, I\'ve got Telerik NumericTextBox: @Html.Telerik().CurrencyTextBoxFor(p => p.Item.Amount)

On my form, I've got Telerik NumericTextBox:

@Html.Telerik().CurrencyTextBoxFor(p => p.Item.Amount)

and javascript sends that form to the controller:

var formData = $("form").serializeArray();
$.post("@Url.Content("~/Diary/Add")", formData );

My problem is, that the CurrencyTextBox doesn't get serialized and sent to the server. I know why it's happening - this control is made of 2 inputs, with messed up names and IDs, so serializer doesn't recognize it as a "successful control" ( http://www.w3.org/TR/html401/i开发者_开发技巧nteract/forms.html#h-17.13.2 ).

Does anybody know if there is any way around it, without any nasty hacks (like manually adding that value to the array)?


You can try using a more up-to-date version. The numeric textbox has only one <input /> now.

0

精彩评论

暂无评论...
验证码 换一张
取 消