Need Help w/InfoPath Browser Form Validation Rule

S

SPuser

Hello,

We are using MOSS/InfoPath 2007 browser enabled forms. We have text boxes in
our form that have the "multi-line" option checked which disables the "limit
text box to X characters" option. In order to enforce character limits, we
used a data validation rule instead. An example of one of the data validation
rule is as follows:

FieldName matches pattern .{101,}

This means that entry into the text box must not exceed 100 characters. This
rule works fine if the user types into the text box. Upon submit/save of the
InfoPath form, an error message is generated and the user cannot continue
until they fix the field and ensure the text is under 100 characters.
However, if the user copies text from another source and pastes it into the
form, it bypasses the validation rule allowing the user to enter more than
100 characters. Perhaps there is another way to write the validation rule to
prevent this from happening? Any ideas or help anyone can provide would be
greatly appreciated.

Thanks
 
S

S.Y.M. Wong-A-Ton

Try the following validation rule on the text box instead:
The expression: string-length(.) > 100
 
S

SPuser

Thank you S.Y.M. Wong-A-Ton.

We replaced the data validation rule with the custom pattern with your
suggestion and it worked even when the user copies and pastes in the text
into the field.

Thank you so much for your help!
 
S

S.Y.M. Wong-A-Ton

No worries.


SPuser said:
Thank you S.Y.M. Wong-A-Ton.

We replaced the data validation rule with the custom pattern with your
suggestion and it worked even when the user copies and pastes in the text
into the field.

Thank you so much for your help!
 

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