Minimum Characters

D

Dave

I'm aware that we can limit a text box control to an amount of characters not
to be exceeded. But can we control the minimum amount of characters that a
user is allowed to input into a text field? For instance, if I ask for
Weight and the user inputs 5 pounds - but I was hoping for 2 to 3 characters,
say 95 pounds or 175 pounds, because nobody weighs 9 or less pounds. Make
sense?

Please assist
Thank you
 
N

nojyttap

There may be an easier way than this but this is how I've done it.

Create 2 text boxes field1 and field2. Field1 will be the one the user fills
in. On field2 set the default value with the function button to
"string-length(field1)". Then in the rules set the condition to 'if field2<2
or field2>3'. Set the action to 'set a field's value', 'field2', ' "" '.
(double quotes will give you a blank) Or you could have a message such as
"This field must be either 2 or 3 characters".

Then set the conditional formatting for field2 to 'if present' then 'Hide
this control'.

Hope this helps.
 
S

Shekar

Hi Dave
You can limit the number of characters for text box by setting the limit
value under display tab of text box properties.

Hope this helps you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top