Home » Developer & Programmer » Forms » How to force user to enter exactly 3 digits in to a number field (Oracle forms)
How to force user to enter exactly 3 digits in to a number field [message #501335] Mon, 28 March 2011 10:49 Go to next message
urnikhil
Messages: 42
Registered: March 2008
Member
Hi All,

There is a text item on my form with NUMBER data type. I want to force the user to enter exactly 3 digits in to that text item. My current FORMAT MASK is set to 990. But this allows user to enter even a single digit where as my requirement is user should enter exactly 3 digits. Can we achieve this by changing the FORMAT MASK property? Please advise.

Thanks,
Nik.

NOTE: Sorry for posting the same message twice by mistake. I didn't find a way to delete one of these messages.

[Updated on: Mon, 28 March 2011 11:00]

Report message to a moderator

Re: How to force user to enter exactly 3 digits in to a number field [message #501390 is a reply to message #501335] Mon, 28 March 2011 14:21 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
What about format mask 000?

however, what is the number is less than 100? The format mask will show leading zeroes, but it will not be stored that way as a number column does not store leading zeroes.
Re: How to force user to enter exactly 3 digits in to a number field [message #501391 is a reply to message #501390] Mon, 28 March 2011 14:27 Go to previous messageGo to next message
urnikhil
Messages: 42
Registered: March 2008
Member
Joy,

Format mask 000 didn't work, even it allows single digit numbers. As per the requirement, the only valid entry in to that field is a 3 digit number. That is the reason I am trying to achieve this.

Thanks,
Nik.
Re: How to force user to enter exactly 3 digits in to a number field [message #501394 is a reply to message #501391] Mon, 28 March 2011 14:59 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why not set lowest allowed value to 100 and highest to 999?
Re: How to force user to enter exactly 3 digits in to a number field [message #501397 is a reply to message #501394] Mon, 28 March 2011 15:05 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Cool; but negative numbers can also have three digits, so ...

Perhaps WHEN-VALIDATE-ITEM trigger is to be used.
Re: How to force user to enter exactly 3 digits in to a number field [message #501399 is a reply to message #501391] Mon, 28 March 2011 15:46 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
urnikhil wrote on Mon, 28 March 2011 15:27
Joy,

Format mask 000 didn't work, even it allows single digit numbers. As per the requirement, the only valid entry in to that field is a 3 digit number. That is the reason I am trying to achieve this.


Really? A format mask of 000 would put leading zeroes for any number you put in the Form. What version are you using? I am 10.1.2.0.2.

I tried 1 and it gave me 001
I tried 45 and it gave me 045
I tired 123 and it gave me 123

like I said, it does not store leading zeroes in the database, only on the form. Is that what you want? On the form or in the database?
Re: How to force user to enter exactly 3 digits in to a number field [message #501584 is a reply to message #501399] Wed, 30 March 2011 00:58 Go to previous message
rmoplusx
Messages: 19
Registered: February 2009
Junior Member
use length function in when-validate-item
Previous Topic: host command not working properly
Next Topic: Stacked canvas on Tab Canvas
Goto Forum:
  


Current Time: Tue Sep 17 05:01:37 CDT 2024