开发者

Telerik MVC controls - serialize NumericTextBox in js

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜