I want the textbox to accept only numeric input

Hi

Already set in text properties to numbers only.

image

Hi
You are right and it gives you a keyboard with numbers only.
But this keyboard shows - , & space which if you use them alone without any number, it result in application failure and close it.

That is interesting because the & is not on my keyboard and the space is but it is disabled.

As far as the negative (-) goes it does not matter because negative numbers are numbers. & and - can easily be removed by the filter I gave .. simple enough. Are you sure your space key is enabled?

JUST curious is all .. your equation has a strange set of numbers for output and makes me wonder how such a set could be viable?

Hi
Sorry my English is weak, I did not mean by & as a character in the keyboard. This is the GBorad I am using:

Try this, uses a label instead of a textbox, and returns the value to a variable on Enter

image

makeAKeyBoardNumbersOnly.aia (20.7 KB)

1 Like

May I ask what happens the next time you press button ? Example text is 5, press button result is 6, next time text input is 6 then result is 7 or 6+6+1=13 ?

Hi
The result would be 7.

Thanks for the nice keyboard.

You could always use regex extension by @Kevinkun to validate numbers for example only integers or even only positives numbers.
For example this will accept only positive integer numbers in calculations otherwise it will return 0 in textbox

2 Likes

Please post a screenshot of the "application failure".

isNumber always returs the correct booleans:

1 Like

Hi
This is the failure message:

Show the blocks (like I did).

Hi

This is the result if I add the - character with out any number with it:

and this if I add numbers:

image

Try this and see if it works for you
numbers_only.aia (7.8 KB)

Great keyboard and easy to build but only positive numbers out

Same keyboard I get .. the space bar is disabled and "-" can easily be filtered out as I already gave blocks for

So where is the problem?

1 Like

Easy enough to add a - key, but not in the original OP's request....

1 Like

Agreed but maybe I misread? I thought he was ONLY concerned with "-" in the case where ONLY "-" was entered as the only character .. appeared to me -1 etc was ok

I like the keyboard and built one very similar to lookup telephone prefixes a couple months ago