Skip to Content Skip to Menu

Validation Rule to Pattern (RegExp)

  • AlecsRU
  • AlecsRU
  • ONLINE
  • Posts: 114
  • Thanks: 3
  • Karma: 0
8 hours 59 minutes ago #341430 by AlecsRU
Validation Rule to Pattern (RegExp) was created by AlecsRU
Dear Community Builder Support,I am running Community Builder 2.4.6 + build 2020‑09‑16 (e1fa0e483) on Joomla 3.10.x.
For one of my registration fields (type Text; name/id
Code:
cb_ue_cbtel
) I need to validate mobile numbers with the pattern:
Code:
^(?:\+7|7)\d{10}$
What I did
  1. Field Manager → cb_ue_cbtelValidation tab
  2. Set Validation Rule to Pattern (RegExp)
  3. Entered the pattern above (no quotes, no spaces)
  4. Saved the field and cleared Joomla & browser cache
Result
  • The input keeps showing the default error message
    “Format: + and 11‑15 digits …”
    even for correct values like
    Code:
    +79991234567
    or
    Code:
    79991234567
    .
  • In the browser console I verified:
Code:
typeof cbjQuery.validator.methods.pattern // ⇒ "function" cbjQuery('#cb_ue_cbtel').attr('data-rule-pattern'); // ⇒ undefined
Code:
data-rule-pattern
is not output in the final
Code:
<input>
element, so jQuery‑Validate never receives the rule. The same happens if I switch the rule to Custom REGEXP Validation.Other CB fields that use built‑in rules (e‑mail, required, etc.) are rendered correctly on the same page.Tried already
  • Disabled the WYSIWYG editor (“None”) to avoid hidden characters
  • Re‑saved the expression several times, copy‑pasting plain text
  • Cleared Joomla cache, browser cache, tried Incognito mode
  • Confirmed that no JS errors are thrown except unrelated extensions
QuestionIs this a known issue in CB 2.4.6?
Could you confirm whether Pattern (RegExp) should still render a
Code:
data-rule-pattern
attribute in this version, or has the syntax/field name changed?Any advice on how to make a custom regular‑expression validation work (or a patched file) would be greatly appreciated.Thank you for your time.Best regards,

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 49306
  • Thanks: 8432
  • Karma: 1465
1 hour 25 minutes ago #341432 by krileon
Replied by krileon on topic Validation Rule to Pattern (RegExp)
Community Builder 2.4.6 + build 2020‑09‑16

Your release is from 5 years ago. I've no idea to be honest. Likely some sort of bug that has long been fixed. You're welcome to go through our ticket tracker below and see if there's any reports of such issue, but some fixes are just not made public or it may have been a bug caused by something else and that something else was fixed.

forge.joomlapolis.com/projects/cb/issues

Is there a reason you can't update your site?


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.

Moderators: beatnantkrileon
Powered by Kunena Forum