1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Field element regex

Discussion in 'Community' started by urbido, Nov 13, 2019.

  1. urbido

    urbido New Member

    Level: Community
    Hi! I have a phonenumber in field element (987654321) and I want to display it like 987 654 321.. that's okay, I would use Nubmer Format & thousands separator " "... but problem is, when phone number is like +420987654321, +421987654321,... it displays like 420 987 654 321 (missing the '+' symbol). Is there any way to display it like I want (+420 987 654 321), without using php validation? I can't force users to input phone nubmers with spaces...
    Thanks!
    Stepan
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    Did you try the "Input mask" (maybe also with regex "Mask definition")?
     
  3. urbido

    urbido New Member

    Level: Community
    But the input mask works for input only, doesn't it? I want user to be able to write 321321321 and see 321 321 321, or write +420321321321 and see +420 321 321 321.
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    One way to do that would be to use a calc element, and display that rather than the actual input field in list view. And have some PHP in the calc which "normalizes" the phone element value.

    The only other way would be to use a PHP validation set to "replace" rather than "match", and format the input that way.

    -- hugh
     

Share This Page