Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Limit number of choice un multiple drop down list

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
11 years 8 months ago #221649 by krileon
That should work. You should also add the before registration trigger and try it there as well. Your redirect should also begin with index.php, no need for live site URL, and it should be non-SEF.


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 or Create an account to join the conversation.

  • nijan
  • nijan
  • OFFLINE
  • Posts: 108
  • Thanks: 1
  • Karma: 0
11 years 8 months ago #221747 by nijan
Hi,

I changed my REGEX like this --> /[A-Z]{2,}/ ... but it fails.
Do I have something wrong in my REGEX ?

and it should be non-SEF


You mean the redirection or the global site SEO configuration ?

Thanks !

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
11 years 8 months ago #221754 by krileon
Your REGEX is checking for 2 or more capital letters. Try the below.

/\w{2,}/

The above matches 2 word characters or more. The below matches 2 letters or more.

/[a-zA-Z]{2,}/

More on REGEX usage can be found below.

www.regular-expressions.info/

You mean the redirection or the global site SEO configuration ?

Avoid redirecting to SEF URLs as they can change. Use the non-SEF URL. Example as follows.

index.php?option=com_comprofiler&task=userdetails

With that URL though it won't work for registration so you may want to use the URL function below, which sends them back 1 URL.

URL: goback


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 or Create an account to join the conversation.

  • nijan
  • nijan
  • OFFLINE
  • Posts: 108
  • Thanks: 1
  • Karma: 0
11 years 8 months ago #221766 by nijan
Both REGEX /[A-Z]{2,}/ and /\w{2,}/ failed.
Look at the printscreen to see my multiple check.


If I use my REGEX /[A-Z]{2,}/ for Anglais|*|Français|*|Russe it would work.

It only works when I select no language. If I select 1 language or more it gives me the error message.
Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
11 years 8 months ago #221768 by krileon
Again, that REGEX will match anything that has 2 or more characters. That's not an accurate way to determine if they selected more than 1 option or not. The below should be able to fake it.

/\|\*\|{1,}/

The separator for multiselects is |*| if there is 1 or more then more than 1 value was selected. Usage as follows

[cb_myfield] Is REGEX /\|\*\|{1,}/


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 or Create an account to join the conversation.

  • nijan
  • nijan
  • OFFLINE
  • Posts: 108
  • Thanks: 1
  • Karma: 0
11 years 8 months ago #221773 by nijan
It seems to work ... partially ;)

Example 1
If I select only 1 I can save my profile. When I return in my profile, I have 1 language.

If I add 1 more language I can save my profile because I only select 1 more. But in fact I have 2 languages !

Example 2
If I select only 1 I can save my profile. When I return in my profile, I have 1 language.

If I add 2 more languages I can't save my profile because I selected 2 news languages.

Conclusion --> I think [cb_myfield] only checks new input.

If I have 2 languages (Select one - Save - Select another one - Save), and if I deselect 1 language, I can't save my profile because I have more than 1 language.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum