kendo-uikendonumerictextbox

Getting Formatted Value in NumericTextBox


When i type the value 123456 in the numeric text box it displays with comma values like 123,456.00

If we access the value it will give me 123456. Now i have a requirement in which i need to get the display value (123,456.00).

Is there any way to get this ?

Thanks in Advance


Solution

  • KendoUI creates a second input for the formatted text with a class of k-formatted-value. So you could use jQuery to get the value of that input as follows:

    var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
    alert(numerictextbox.element.parents(".k-numeric-wrap").find("input.k-formatted-value").val());
    

    DEMO