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 »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Adding a custom field using the buildForm Hook
Pages: [1]

Author Topic: Adding a custom field using the buildForm Hook  (Read 1116 times)

nrporter

  • Guest
Adding a custom field using the buildForm Hook
September 28, 2009, 11:49:42 am
I was wondering if it would work to add a custom field to the create and edit forms for Events using the buildForm hook, and then using the postProcess hook to handle the information that the custom field passes as part of the form. If it can be done, how would the hook be used to add the field, and would I need to edit the template files for the form. My goal is to make changes only using the modules so that my clients base installation of civiCRM remains un-altered as once this project is over, I will not be continuing to support it. Thanks again for all the help here in the forums, you guys are great

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: Adding a custom field using the buildForm Hook
September 28, 2009, 05:58:17 pm
yes you can do that. The hook documentation has quite a few examples:

http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification

also civitest.module.sample has quite a few examples. Finally there is a pretty large comprehensive (though not very well documented) example of a live module here:

http://svn.civicrm.org/sfschool/trunk/

some blog posts of the above module here: http://civicrm.org/taxonomy/term/26

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) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Adding a custom field using the buildForm Hook

This forum was archived on 2017-11-26.