Decimal numbers

Jan 04, 2018

Hi, 

Is there any way to prevent users from entering decimal numbers and words/alphabets in the text field? I would like them to enter numbers only. And the text field has to be blank each time it is reset or revisit. I don't want to see a '0' (zero) when it is reset or revisit - this is why I didn't use a numeric entry field for my project.

Appreciate your help.

Thanks.

5 Replies
Megan Yeo

Hi Matthew

Thanks for your help!

The approach works well! However, I encountered another issue when I added this new trigger. The 'Submit' button remains disabled until the user enter a number in the text field. Once the user enters a number in the text field, the Submit button becomes Normal. In this case, when the user enters a decimal number, an error message shows up, and at the same time, the Submit button becomes Normal. I have tried to disable the Submit button if the user enters any decmial number using the below trigger but it is not working:

Action: Change state of

On Object: Submit button

To State: Normal

When: Variable changes

Variable: TextEntry

On Condition: TextEntry not equal to '.'

Besides that, is there any way to prevent the users from entering alphabets/words?

Thanks once again!

Nicole Legault

Hi Megan!

When you insert a Numeric text entry field, the field itself will be blank and have nothing in it, by default. It does not have a 0 (zero) in it. Its empty. Also, when you use a numeric text entry field you can only enter numbers, no text. For these reasons, I would suggest you use a numeric text entry field instead. 

Hope this helps! 

Megan Yeo

Thanks for your suggestion Nicole.

I actually used the Numeric text entry field earlier. And it does show a zero when I used it and I can't seem to remove it. That is why I used the text entry field in the end. I'm using SL3. Perhaps there is a different way that you use the Numeric entry field? Can you please show me how it is done?

Thanks.

This discussion is closed. You can start a new discussion or contact Articulate Support.