I'm trying to get a decimal value into the Kendo numeric textbox from a viewmodel (MVC)
The value for the numeric textbox stays empty in Chrome but not in IE.
Besides that I notice a difference in de HTML output between IE and Chrome:
IE
<input name="Value" class="k-input" id="Value" role="spinbutton" aria-disabled="false" aria-readonly="false" aria-valuenow="125,1" style="display: none;" type="text" value="125,100" data-val-required="The Value field is required." data-val="true" data-role="numerictextbox" data-val-number="The field Value must be a number.">
CHROME
<input data-val="true" data-val-number="The field Value must be a number." data-val-required="The Value field is required." id="Value" name="Value" type="text" value="125,100" data-role="numerictextbox" role="spinbutton" style="display: none;" class="k-input" aria-valuenow="" aria-disabled="false" aria-readonly="false">
The initial value of the aria-valuenow is empty in Chrome where IE provides the actual value from the (view)model.
7 Answers, 1 is accepted
The behavior you describe seems rather strange. I tried to replicate it in the NumericTextBox examples, however, I was not able to.
Would you send us a runnable project or a dojo sample where the behavior is replicated. This will enable us to examine the issue locally and look for its cause.
Regards,
Viktor Tachev
Telerik by Progress
Hi Victor,
Ok I've included an asp.net mvc testproject (NumericTextboxInChromeIssue.zip).
I you run it in both IE and Chrome you will see a difference in behaviour netween the two browser.
So far i can see the problem is only present in Chrome.
There is nothing attached to your post. Please note that sending archives in the forums is not possible.
With that said, please ensure that you have specified matching cultures on the client and server. If there are different cultures the decimal value sent from the server may not be parsed correctly on the client. As a result the numeric input would show nothing.
The article below describes in detail how you can set matching cultures.
In case the issue persists please open a support ticket and attach the test project there.
Regards,
Viktor Tachev
Telerik by Progress
Hi Viktor,
I like to attach a zip file with the project, but it exceeds 20mb and I can't upload it.
Is there an other way to send the project zip to you?
In order to attach a project you should open a support ticket. In order to reduce the size of the archive you can remove the Telerik assemblies.
Alternatively, if the project does not contain sensitive information you can upload it on a file sharing platform and send us the download link.
Regards,
Viktor Tachev
Telerik by Progress
Hi Viktor I have the same problem, you can use this code to reproduce the issue in chrome, IE and Firefox work find
@(Html.Kendo().NumericTextBox<double>()
.Name("numeric")
.Value(17.5)
.Step(0.01)
.Culture("es-ES")
.Placeholder("Enter numeric value")
.HtmlAttributes(new { style = "width: 100%", title = "numeric" })
)
Please ensure that you have specified matching cultures on the client and server. Furthermore, update the components to the latest version. The current release is 2017.3.913.
In case the behavior persists after the modifications please send us a dojo sample or a runnable project where the behavior is replicated.
Regards,
Viktor Tachev
Progress Telerik