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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Understanding the reference to a form in the postProcess hook
Pages: [1]

Author Topic: Understanding the reference to a form in the postProcess hook  (Read 935 times)

EdP

  • I post frequently
  • ***
  • Posts: 260
  • Karma: 7
  • CiviCRM version: 4.4
  • CMS version: Joomla 2.5.x
Understanding the reference to a form in the postProcess hook
July 10, 2010, 12:21:57 pm
The postProcess hook "is invoked when a CiviCRM form is submitted", according to the documentation. My understanding is that a "form" in this context is (in Joomla) a profile that you can see from the front end, e.g. via the menu link, which you can then submit. In the sample code for how to use it there is a line:

Code: [Select]
if ($formName == 'CRM_Contract_Form_Contact') {

and something similar is done in the example code here: http://forum.civicrm.org/index.php/topic,12431.0.html but with a different name.

How do I find out the name of a form? I know the name of the profile ("Contact Us") but that doesn't get me anywhere, and the example code seems to be testing for the specific profile by number later. So what is this test doing, and how do I find the name of the form that applies for the profile I'm applying it to?
 
Sorry if this is a really clueless question!
Thanks.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Understanding the reference to a form in the postProcess hook
July 11, 2010, 10:23:28 am
Quote
How do I find out the name of a form?

I guess go to the form and just print $formName in your hook. That should give you name of the form.

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Understanding the reference to a form in the postProcess hook

This forum was archived on 2017-11-26.