We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ej-numbertextbox: Value doesn't represent what's being displayed to the user

Hello.

We're using the ej-numerictextbox control. We've implemented it using AngularJS.

We are binding to it via the ng-model directive, and the e-value directive.

Steps to Recreate

We've encountered the following problem:

We have a max value of 4000 being applied to the control (using e-maxvalue="4000").

When enter 4000 into the control.

We then enter an additional 00 and it displays as 40000 (the first 0 entered isn't displayed, the second is). This could occur if the user holds down the 0s as a shortcut to get the max value.

If we click or tab away, it reverts to display 4,000 (which is great - that's the value we want).

However, the value associated with the control is actually 4,0000. And as a result, this is what is saved to the database.

Could you fix the control please so that the value associated with the control in this instance is what's displayed to the user.

Many thanks.


3 Replies

SN Sasikala Nagarajan Syncfusion Team February 16, 2016 05:39 PM UTC

Hi

Thanks for contacting Syncfusion support,

We have checked with your query and we suspect that the issue may be caused due to specifying the both “ng-model” and “e-value” in NumericTextbox control. Please bind the “e-value” only in ej numeric text control, it will adds the ng-model and required options automatically, if you render the component inside the form control.

Please refer the below code example,

[html]
           
 <input id="numeric" type="text" ej-numerictextbox e-value="nvalue" e-maxvalue="4000"/>


For your convenience, we have prepared the simple sample to showcase this. Please refer the below link

http://jsplayground.syncfusion.com/rnlt3phf


Please check with given solution and let us know if you have further queries,

Regards,

Sasikala Nagarajan


GG Greg Gannicott February 17, 2016 11:52 AM UTC

Hi.

Thanks for the response.

Unfortunately, when you remove ng-model, the user is able to enter (for example) 400000000000. When the control loses focus it is reduced to 4,000, but we require that the user is unable to input more than the maximum amount at the time of input, as we feel this is a better user experience.

Is this possible?

Thanks.


SN Sasikala Nagarajan Syncfusion Team February 18, 2016 01:01 PM UTC

Hi Greg,

Thanks for the update. Currently there is no option to validate the min and max values at the time of input instead of validating the values in control focus out. Already we have logged your reported requirement  as a feature request  in our database. A support incident to track the status of this feature has been created under your account. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents


Regards,
Sasikala Nagarajan

Loader.
Up arrow icon