Skip to Content Skip to Menu

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

browser-side verification for fields based on a regular expression

  • zerodd
  • zerodd
  • OFFLINE
  • Posts: 14
  • Thanks: 2
  • Karma: 2
11 years 3 months ago #231341 by zerodd
Dear,

We are building for our client a social network targetted at pharmacists in Italy. We verify the fact that they are indeed qualified to subscribe trough their primary e-mail address, which should be a 'pharmacy-only' e-mail. Such an e-mail address exists, it's a very typically Italian thing, look up 'PEC' if you're curious :)

This means that for the primary e-mail input in registration, we want to verify not only that it is a valid e-mail address, but more strictly than that that it satisfies a regular expression that we provide. We included this regular expression in the CB field manager for e-mail, and indeed upon registration form submit it returns an error when the e-mail provided does not fit our regex. So far so good.

HOWEVER, we are using the 'cb conditional' plugin, to split the registration process in multiple conditional steps for the user. It is in the 'step 2' out of 4 steps of our registration that the e-mail input occurs, and we would love for this regex to be verified client side, as soon as the user presses NEXT. We enabled 'Validate' in the CB conditional configuration section, and this does client-side verification for passwords, required fields and e-mail addresses, but not for our regular expression. Could we somehow make this work?

IN SUMMARY our question is the following: when we enable 'validate' in the CB Conditional plugin for multi-step verification, can we also have it validate regular expressions client-side? (and thus, in our case, specifically, one that we provided for the primary email field)
Thanks a lot!

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 3 months ago #231343 by krileon
It should validate the regex. It fires a simulated form submit so the normal validation kicks in. Aside from that there's nothing I can do about it if it's not firing until the form actually submits.


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