1. Laurent Zotto
  2. General
  3. Monday, October 17 2016, 03:30 PM
Hello

I have implemented EaysProfile successfully.
I'm now wondering if I can add an allowed pattern for a profile field, i.e.: PHONE must begin with a country code, like (+33, +1, +352) .. and make this appear in the resulting error message if this is not the case.

For now, on my web page the PHONE filed without a country code is not allowed, bu when entering a phone numeber like "12 34 567" I simple get the message "wrong field PHONE".

I there a solution to this? Thank you in advance

Regards
Laurent
Accepted Answer
Laurent Zotto Accepted Answer
Good, I was already wondering what this is for...
$Thank you, I will try so.
  1. more than a month ago
  2. General
  3. # Permalink
admin Accepted Answer
Admin
Hi,
unfortunately we not have control about phone validation (it comes from HTML5 + Joomla validation).

Anyway you can use a Text field type and add your custom format. see screenshots.

Something like

[0-9 ]+
should allow numbers and spaces
Attachments (1)
  1. more than a month ago
  2. General
  3. # 1
Laurent Zotto Accepted Answer
Obviously the validation works, but the message is not clear on what is wrong!
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
I know, but message comes from Joomla, not Easy Profile, JForm API of Joomla not allow natively to add error messages on client validation.
Keep in mind that Easy Profile extends Joomla user management (not replace), so registration form is the same of Joomla and it uses Joomla validator.

You need to write some javascript function to customize your message.

Or more simple:
- add description in phone field (this will be shown as tip, see screenshot)
- add HTML delimiter after phone field to describe valid format
Attachments (2)
  1. more than a month ago
  2. General
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.