Ajax Forms and Percentage Input using Factor

4 posts, 0 answers
  1. Brian
    Brian avatar
    4 posts
    Member since:
    Jan 2017

    Posted 21 Jul Link to this post

    Hello,

    I am using the numeric text box as a percentage input with a factor of 100.Typing '100' into the form field produces '100%' as expected. When I submit the form via an Ajax request, '100' is sent back to the server instead of '1'. I inspected the numeric text box element to find the value attribute is '100'. When I inspected the widget via .data('kendoNumericTextBox') the value is '1'.

    Is this expected? Shouldn't Kendo make sure the value attribute on the element is the same value as the widget?

    Thanks

  2. Stefan
    Admin
    Stefan avatar
    1147 posts

    Posted 25 Jul Link to this post

    Hello Brian,

    Thank you for describing the specific scenario.

    I made an example and the value of the widget is 1 when the percentage is 100:

    http://dojo.telerik.com/eluQI

    Please advise if I missed an important detail.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Brian
    Brian avatar
    4 posts
    Member since:
    Jan 2017

    Posted 27 Jul in reply to Stefan Link to this post

    Hi,

    This is what you need to reproduce the issue. In your example, change the numeric text box code to:

          $("#numerictextbox").kendoNumericTextBox({
            format: "p0",
            min: 0,
            step: 0.01,
            factor: 100
          });

     

    Repro Steps:

    1. Type 10 into the percent input. It should change to 10%.

    2. Inspect the element and notice the input element's value attribute is "10"

     

    Expected Result:

    The value attribute should be 0.1   (.1 = 10%)

     

    When a form is submitted it takes the value attribute "10", but the desired value should be ".1".

  4. Stefan
    Admin
    Stefan avatar
    1147 posts

    Posted 31 Jul Link to this post

    Hello Brian,

    I used the provided configuration, placed it in the Dojo example and the value of the widget is 0.1 as expected.

    http://dojo.telerik.com/eluQI/3

    If the issue is with the aria-valuenow attribute, please advise, as this is used for the screen readers, where if the user knows that this is %, it is expected to read the percent value. If this is not expected based on the Aria attributes specification, please let us know and we will investigate it.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top