This is a migrated thread and some comments may be shown as answers.

serializeArray and problem

3 Answers 143 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Gusev
Top achievements
Rank 1
Gusev asked on 01 Jul 2013, 08:21 AM
Hello!
I use serializeArray  for form.
But this function doesn't return object, which have disabled fields
I use:
@(Html.Kendo().IntegerTextBoxFor(m => m)
      .Enable(false)
      .Spinners(false).....
But if I use:
@(Html.Kendo().IntegerTextBoxFor(m => m)...
All good.
Question: Need I get this(disaled) field by $(..[name="...]) or that I can do?

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 03 Jul 2013, 07:35 AM
Hello,

The values of disabled inputs are not posted. If you wish the Users not to be able to edit the value but still post the value then you should make it readonly.

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Gusev
Top achievements
Rank 1
answered on 03 Jul 2013, 10:51 AM
Hello!
Thanks for help!
But....
I don't see in this @(Html.Kendo().NumericTextBoxFor(m => m) .......ReadOnly or Enable(ReadOnly)
I don't want to use js to I could change to "read" options
Why this option not included inside this wrapper?
0
Daniel
Telerik team
answered on 05 Jul 2013, 08:51 AM
Hello,

There isn't currently a configuration option that can be used to make the controls readonly. This should be done by calling the readonly method in JavaScript. From the code that you provided it seems that you can use something similar to the code in the snippet below:

@model int
 
@(Html.Kendo().IntegerTextBoxFor(m => m))
 
<script>
    $(function () {
        var id = '@Html.ViewData.TemplateInfo.GetFullHtmlFieldId("")';
        var numeric = $("#" + id).data("kendoNumericTextBox");
        numeric.readonly();
    })
 
</script>
Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
NumericTextBox
Asked by
Gusev
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Gusev
Top achievements
Rank 1
Share this question
or