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) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Custom Field Issues
Pages: [1]

Author Topic: Custom Field Issues  (Read 506 times)

ltgreen1

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: joomla
  • MySQL version: 5.0.7
  • PHP version: exit;
Custom Field Issues
March 28, 2013, 09:49:38 am
Can you point me to any information regarding restricting the data field length of integers and numbers in custom fields?  I want to create a field for the last 4 digits of a SSN and another thing like that and force the user to the parameters I set…  can’t seem to find where to get that done…. this is a wordpress install (not my idea)....

thanks
LT

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: Custom Field Issues
March 29, 2013, 05:59:13 am
You can not set the length of the integer type custom field in any definition. There are several ways to make sure the user only enters 4 digits:
* create a customized template that limits the size of the input field on the screen
* use the validateForm hook to add your own validation to a custom field
You should do both in a CiviCRM native extension.

More information can be found here:
http://book.civicrm.org/developer
and on creating extensions:
http://wiki.civicrm.org/confluence/display/CRMDOC42/Create+a+Module+Extension#CreateaModuleExtension-Addabasicwebpage
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

ltgreen1

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: joomla
  • MySQL version: 5.0.7
  • PHP version: exit;
Re: Custom Field Issues
March 30, 2013, 11:58:33 am
thats what ill do.  thanks for the reply

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: Custom Field Issues
March 31, 2013, 03:05:48 am
Let us know how you get on and shout here or on IRC if you need more help
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Custom Field Issues

This forum was archived on 2017-11-26.