Format that should accept only positive numbers

Questions and answers for designing and implementing forms in Servoy

Format that should accept only positive numbers

Postby anuja.dalal » Mon Mar 25, 2013 8:18 pm

Servoy version: 6.1.4 i1.

We are applying format over a field so that it should only accept numbers of length 8. Format is applied on table level. Data type of column is number in database.
Display/Edit format that has been used is ########. Now the problem is, it allows user to input -, % and $ sign. In order to prevent user from inputting negative number we also used NumberRangeValidator on the same field. Although we prevented -ve numbers but problem comes when user tries to input something like '123-456'. It truncates string '-456' leaving just '123' behind. Is there format mask available that will not let user input something like this at first place. Is there a way we can force user to input only numbers in the field using format.

Thanks,
Anuja
anuja.dalal
 
Posts: 2
Joined: Sat Mar 02, 2013 12:27 am

Re: Format that should accept only positive numbers

Postby david » Tue Mar 26, 2013 1:08 am

Write your own column converter. It's not hard—example template you can refer to: https://www.servoyforge.net/projects/fractions/wiki
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Format that should accept only positive numbers

Postby chaitanyas » Tue Mar 26, 2013 8:38 am

HI @anuja ,

Follow this post for accept only positive numbers,

viewtopic.php?f=2&t=15937

Thanks
Chaitanya s
chaitanyas
 
Posts: 101
Joined: Tue Jul 26, 2011 8:28 am


Return to Forms

Who is online

Users browsing this forum: No registered users and 5 guests

cron