Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

dxNumberBox - How to allow entering only integer/float numbers

$
0
0

This example demonstrates how to allow entering only numbers in dxNumberBox. For this task we need to handle the dxNumberBox.keyPressAction event and check whether the typed symbol is a number. If this is not a number, prevent the default action of the event by calling the preventDefault method of the event object that is passed to the keyPressAction event handler.

See also:
JavaScript RegExp

Question Comments

Added By: CM Tee at: 6/18/2015 9:06:10 PM    

hi, the syntax on view got error during runtime,

<div class="dx-field-value">
                   <div data-bind="dxNumberBox: integerSettings { value: qty, min: 1 }"></div>
               </div>

please help.

Added By: Alex Skorkin (DevExpress Support) at: 6/19/2015 1:20:53 AM    

Hello Jerry, 
To process your recent post more efficiently, I created a separate ticket on your behalf: T257499: The syntax for dxNumberBox interger values got error during runtime. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>