dumb question about input formatting

my client has a field on a form (“state”) and for some reason,
data entry people are putting numbers in it!

they’re asking me to only allow characters to be entered
in this field, but i’m not sure how to do this.

can this be done with a simple field-format string?

thanks in advance.
rm.

Hi Robert,

NOT a dumb question at all. There is no “input mask” property of a field - so you can do it with a method attached to the “onDataChange” event of the field.

You should check out the great (and FREE) plug-in from I2BE that will do the validation for you (isNumeric, isString, etc). You can find it in the “Plugin and Beans” section. Or, just click here: Tools plugin 1.7 (improved zip & unzip) - Classic Servoy - Servoy Community

Hope this helps,

Bob Cusick

thanks for your quick reply, bob.

i’ll look at it right away.

hey, how does one write a plug-in anyway?

Chekc out: http://developer.servoy.com/generic.jsp?taxonomy_id=299
for a crashcourse about writing plugins.

Paul

in 2.1.2 the format field also works on textfields (one line so not the textarea)

you can do this for example a format like:

###-####|555-1234

will give you an input field that only can have 7 numbers (you can’t type anything else) and has a default value of 555-1234

these masks are possible:

Character Description

Any valid number, uses Character.isDigit.

’ Escape character, used to escape any of the special formatting characters.
U Any character (Character.isLetter). All lowercase letters are mapped to upper case.
L Any character (Character.isLetter). All upper case letters are mapped to lower case.
A Any character or number (Character.isLetter or Character.isDigit)
? Any character (Character.isLetter).

  • Anything.
    H Any hex character (0-9, a-f or A-F).

// EDIT: wrong version number feature from 2.1.2 >

Great work Johan! :D
THANKS!

i’m running 2.1, build 310, and this doesn’t seem to work.

i tried putting in the format field:

UU

as well as:

UU|UU

i’m still able to enter numbers, and lower case letters
are not set to upper case.

am i misunderstanding something?

I think Johan means: 2.1.2 and not 2.0.2
So it’s in the next release.

OH! very good. thank you.

(and thanks for the tools; i just downloaded your plugin and
started working with it. nice job!)

rm.

My plugins? Tell me, where! :lol:
I never made one yet! :lol:

oops!

wrong person!

i was thinking of “it2be” :oops: