realbasic-nug
[Top] [All Lists]

Re: Easy way to permit numbers exclusively?

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Easy way to permit numbers exclusively?
From: Dennis Birch <dsbirch at qwest dot net>
Date: Wed, 30 Jan 2002 11:03:32 -0800
At 12:35 PM -0600 1/30/02, J Draper wrote:
I have editfield1

I want to do a calculation on amount entered but user likes to enter 100,000

What the easy way to suppress the users comma?

Loop and check the ASCII value of each letter entered?

Is there a mask that can be ued on the input of data?

Check in the keydown event of your EditField. If the user enters an unwanted key, return true. This tells RB that you have handled the event and it doesn't need to do anything (like put the character in your editField). You might also want to beep before returning true to give the user some feedback, so they don't think your application is simply broken.


<Prev in Thread] Current Thread [Next in Thread>