Text filtering in a text field

T

Terence

Guest
Hi, am new to SKILL and would like to do some text checking and
filtering for illegal characters in the text field. Meaning I have a
text field in my form that is only to be with text, not any of the
symbols (i.e. ~!@#$%^&* and so on). When the user input and saved the
fields, those characters won't be allowed to be saved.

What will be the best way to filter out only text? Only numbers?
 
Terence <terrylau77@gmail.com> writes:

Hi, am new to SKILL and would like to do some text checking and
filtering for illegal characters in the text field. Meaning I have a
text field in my form that is only to be with text, not any of the
symbols (i.e. ~!@#$%^&* and so on). When the user input and saved the
fields, those characters won't be allowed to be saved.

What will be the best way to filter out only text? Only numbers?
I know of three ways, which one to use is when you want to do the filtering:

- register a callback for the field which does the checking and set the
field value to a fixed value. Pay attention not to be called recursively
:)

- register a callback for the form which check the coherence of the whole
form.

- the StringField (and perhaps other) also have a modifyCallback which can
be used to filter out characters as they are typed.

$CDS_INST_DIR/doc/skuiref/skuiref.pdf is where to search for such things.

Yours,

--
Jean-Marc
 

Welcome to EDABoard.com

Sponsor

Back
Top