Making the TextField allow only decimal values

Guys,

I’m wondering how to make the textfield allow only decimal values. I know there is an option for inputType “decimal”, but it is also allowing me to key all the alpha numerical characters and special characters too. Is there any way so that my textfield only allows to enter decimal values and no other characters?  

Hi mithunporandla,

I think the inputType you want is “number”. This brings up a traditional number pad on Android.

If you want to explore more of the inputType options for keyboards, see the NativeKeyboard example that comes with Corona SDK.

Alternately, you can view it on GitHub here.

Hi mithunporandla,

I think the inputType you want is “number”. This brings up a traditional number pad on Android.

If you want to explore more of the inputType options for keyboards, see the NativeKeyboard example that comes with Corona SDK.

Alternately, you can view it on GitHub here.