CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Form-field value masking
Pages: [1]

Author Topic: Form-field value masking  (Read 1071 times)

kimkennof

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.1.3
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5.2
Form-field value masking
October 02, 2012, 09:15:30 am
Hi everyone,

My client would like to help users properly fill in the values, in for ex. the New Contact form. I had already done this before in some projects, using the excellent jQuery Masked Input plugin (http://digitalbush.com/projects/masked-input-plugin/)

The typical example would be to fill in a telephone number in a preset format but already I ran into some difficulties:

1. because a telephone number is not address-based (country prefix), I can not specify a "+__" mask

BE => +32
NL => +31
FR => +33
etc

2. because in Belgium, a telephone number can have various formats and lengths

+32 (0)2 123456 (brussels, short)
+32 (0)2 1234567 (brussels, long)
+32 (0)53 123456 (aalst, short)
+32 (0)53 1234567 (aalst, long)
+32 (0)4 75 123456 (mobile)

3. because the user can change the "type" of number to "fax", which can then again require mask-changes

4. because in my other projects, the telephone field was usually included in some sort of "Address" container, making it potentially dependable on the Address-Country.


Should my client really need this, this would require a serious effort trying to specify all posible masks and lengths, for all defined Civi Countries (in the address lists) and all possible devices (fixed, mobile).

Therefor the following questions:

1. Is this feature something the community can benefit from? Is this something you guys would feel happy to have as a usability improvement?

2. Should this functionality be a part of a country-central system for

--  currencies
    ---- with dot(.) or comma(,) as decimal sign,
    ---- with or without thousand sign, ...

--  dates
     ---- YYYY-MM-DD,
     ---- DD/MM/YYYY, ...

--  telephones,

--  VAT numbers,

etc

which can then be used to centrally provide fields / mask field / validate values / ... ?

I would probably check out the Ubercart / Commerce modules how they handle this sort of Country-specific data.

Ubercart (6): *.CIF files
Commerce (7): unknown?

Greets,
Kim

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Form-field value masking
October 02, 2012, 10:47:48 am
Kim,
there is still some stuff required for international usage, check for example this blog post http://civicrm.org/blogs/erikhommel/street-parsing#comment-6863

I certainly think this is something the community can benefit from, and I would love to do a Dutch Extension, including some option value setup and some custom fields. I also expect that this work will have to be done in the community, so combining forces and perhaps creating some M-I-H initiatives?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Form-field value masking
October 02, 2012, 04:54:49 pm

Kim:

using an extension to customize a civicrm install for a specific country / language / locale seems like the right thing to do moving forward

would be great if you can work / coordinate with erik hommel and get the project moving ahead. There are lots of things we can and should do to make civi easier to use in other locales, so definitely will be very very useful to the project. We should learn and use the best stuff from ubercart/commerce etc

If there are changes we need to make in core to make the above happen, we'd be happy to work with you and get it done for 4.3 :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Form-field value masking

This forum was archived on 2017-11-26.