You are viewing limited content. For full access, please sign in.

Question

Question

Validating a character in a field

asked on July 17, 2019 Show version history

We have a form that prompts for a userid using the format of domain\userid (usa\SmithJ).  However, despite of including notes above and below the field, users insist on using the forward slash instead of the the backslash.  Can someone share how to check for the forward slash when the user tries to jump to the next field and if it exists, pop up an error message?  I was thinking about using the "Regular Expression For Validation" in the Advanced tab, I don't know how to stop the process from going forward and pop up an error message.

0 0

Replies

replied on July 17, 2019

If you set a regular expression, the validation will flag it in red and prevent form submission.

[^/]+

This would specifically prevent any forward slashes, but you probably want something more robust, it just depends on what characters are allowed for your user id.

For example,

[A-Za-z0-9]+[\\]{1}[A-Za-z0-9]+

This would require:

  • 1 or more letters/numbers, followed by
  • exactly 1 backslash, followed by
  • 1 or more letters/numbers

 

If your users are all on the same domain, then you could save them time by setting the DOMAIN\ part as a default for the field then they would only need to enter the rest.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.