Where is NumericField/DecimalField?

You must Login before you can answer or comment on any questions.

Is there an easy way to create NumericFields/DecimalFields with Titanium? If not. Is there some examples showing how to create TextFields that only support numeric input, length of input, formatting decimal numbers etc. It would be nice to have:

var decimalfield = Ti.UI.createDecimalField({
        length: 10,
        decimals: 2
    });
var integerfield = Ti.UI.createNumericField({
        length: 10
    });

1 Answer

You can create "TextField" component and set it's keyboard type. For all options see kitchensink example: https://github.com/appcelerator/KitchenSink/blob/master/Resources/examples/textfield_keyboards.js

— answered 2 years ago by Ivan Škugor
answer permalink
4 Comments
  • Thank You. But it is till possible to change the keyboard and write letters. And I still have to handle thousand separator etc. Any thoughts on how to handle that?

    — commented 2 years ago by Thomas Neerup

  • I'm not sure what keyboard do you use (and for what OS do you develop), I use "Ti.UI.KEYBOARD_NUMBER_PAD" for numeric only input (~ integers).

    — commented 2 years ago by Ivan Škugor

  • Ohh.. Sorry. I'm developing for an iPad.. And when i set;

    keyboardType : Titanium.UI.KEYBOARD_NUMBER_PAD,
    The ABC(switch) button is still visible and the user can switch the keyboard. And at the same time the -/:;()$ etc. is still on the keyboard..

    — commented 2 years ago by Thomas Neerup

  • Show 1 more comment

Your Answer

Think you can help? Login to answer this question!