Validate numeric form field entry

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
technopak
Posts: 287
Joined: Thu Dec 04, 2008 2:16 pm

Validate numeric form field entry

Post by technopak »

hi,

I've come across a strange one -

I have a BO form with fields for entry of numeric attribute values. I've noticed that if a user inputs anything except a number in those fields, that the system returns an error message and the creation of the particular object fails completely - the user must re-commence creation of the record.

Can someone suggest the best way of validating such form field entry ? I can't seem to get a rule such as the following to work. It never reports an error.

If NOT (Object.Deposit BETWEEN 1 AND 1000000) THEN
REPORT ERROR 'Value of Deposit is invalid'

Sorry if this is obvious, but what am I doing wrong ?

As usual, thanks in advance :-)

Peter
e5n_devildog
Posts: 34
Joined: Mon Mar 16, 2009 3:06 pm
Location: Ohio

Post by e5n_devildog »

Pete,
Try the format option of the attribute. It should limit the allowable text to the field. Also there is a range specification at the bottom of the attribute screen.

Something like # as the format then specify the range below.
Devil Dog
***Build 1549***
e5n_devildog
Posts: 34
Joined: Mon Mar 16, 2009 3:06 pm
Location: Ohio

Post by e5n_devildog »

Sorry forgot to mention. I can shoot you the bsv if you need me to. Just give me an email.
Devil Dog
***Build 1549***
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Peter,

You must be trying to input into a PLAIN TEXT type attribute rather than a NUMBER type attribute. If you use a NUMBER type attribute, AwareIM will NOT allow anything but numbers to be input. If the user tries to type in letters, they will not even appear on the screen.
Tom - V8.8 build 3137 - MySql / PostGres
technopak
Posts: 287
Joined: Thu Dec 04, 2008 2:16 pm

Post by technopak »

Thanks Devil Dog,

Your post is a big help.

I changed the format on my Deposit field to # as suggested (it had been #.00) and now at least the field only accepts numbers. So that is an improvement.

I'm quite baffled about why the field should accept non-numeric input when the format was #.00

Any ideas ?

Peter
technopak
Posts: 287
Joined: Thu Dec 04, 2008 2:16 pm

Post by technopak »

Thanks Tom,

My issue seems to be about the #.00 format allowing any alpha character input.

I don't know why it should. I'm using build 1188, wondering was there a bug or something ......


Peter
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Peter,

That sure looks like a minor bug. I'll send a bsv over to support to document it.
Tom - V8.8 build 3137 - MySql / PostGres
e5n_devildog
Posts: 34
Joined: Mon Mar 16, 2009 3:06 pm
Location: Ohio

Post by e5n_devildog »

What about using #.## format?
Devil Dog
***Build 1549***
e5n_devildog
Posts: 34
Joined: Mon Mar 16, 2009 3:06 pm
Location: Ohio

Post by e5n_devildog »

Nevermind I see that #.## still gives the issue.
Devil Dog
***Build 1549***
technopak
Posts: 287
Joined: Thu Dec 04, 2008 2:16 pm

Post by technopak »

Thanks Tom and Devil Dog,

At least I'm not losing my marbles :-)

Even using #.##, the field still accepts alpha input.

Has anyone tried this on a later release ? Has the issue been sorted I wonder ?

Peter
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

#.00 is an issue on build 1195. It still accepts alpha. I'm sending bsv demonstrating that to support today.
Tom - V8.8 build 3137 - MySql / PostGres
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

My bsv to support will also show that #.## is an issue.
Tom - V8.8 build 3137 - MySql / PostGres
technopak
Posts: 287
Joined: Thu Dec 04, 2008 2:16 pm

Post by technopak »

Thanks Tom,

I'll look forward to the next release to sort the issue so.


Peter
tazzmaxx
Posts: 125
Joined: Tue Sep 02, 2008 2:13 pm

Post by tazzmaxx »

It must be some form of truncation of non-numeric characters that the system is doing when saving the record since:

44.A = 44
44.12A = 44.12
44.A12 = 44

Thanks for sending the bsv to support Tom.
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

This behavior is a "limitation". Any number format other than "#" will allow alphanumeric input. However, Aware IM should still validate the number properly when an invalid value is saved and display the appropriate error message.
Aware IM Support Team
Post Reply