Authorized input not validating properly?

7 years 5 months ago #287522 by bcraigie
CB 2.0.15 on J 3.6.4

I require all my users when they sign up to provide both forename and surname in the Name field, so I have set the Name field Authorized Input box to Multiple Words With Spaces, and yet users can still sign up with just one word and no space(s).

Is this an error, or is that the way the validation is intended to work?

I have found that this regex works to enforce at least 2 words:

/[a-zA-Z]+\s+[a-zA-Z]+/g

Can I just confirm that this is the correct format for Community Builder?

Thanks

Brian

Please Log in to join the conversation.

7 years 5 months ago #287529 by krileon
Replied by krileon on topic Authorized input not validating properly?
I'd probably use something like the below, which is a little more strict.

/^[a-zA-Z]+ [a-zA-Z]+$/

It explicitly expects a single space between 2 words of any length. It also means the two words must be at the beginning and the end using ^ and $. With your usage you're allowing more than 1 space and the words can be anywhere so it'll match as long as it has at least 2 words somewhere in it.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

7 years 5 months ago #287741 by bcraigie
Replied by bcraigie on topic Authorized input not validating properly?
Thanks, however some people have a middle name or initial, so it doesn't work for them.

So I've used:

/^[a-zA-Z]+\s+[a-zA-Z].*/

Which forces at least two words but allows more. I know they can type extra arbitrary text after the minimum two words, but our moderators can handle that.

Could the "Multiple words with spaces" regex bug be fixed in a future release so that it does as it implies? At present it does not enforce multiple words. :-)

Thanks

Brian

Please Log in to join the conversation.

7 years 5 months ago #287748 by krileon
Replied by krileon on topic Authorized input not validating properly?
In the case of support middle name you can add an optional 3rd word being allowed with the below.

/^[a-zA-Z]+ [a-zA-Z]+(?: [a-zA-Z]+)?$/

Could the "Multiple words with spaces" regex bug be fixed in a future release so that it does as it implies? At present it does not enforce multiple words.

It's not bugged. It's allowing multiple words with spaces. It's not restricting it to multiple words with spaces.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.377 seconds

Facebook Twitter LinkedIn