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 Profiles (Moderator: Dave Greenberg) »
  • Requirement of having HIDDEN TEXT BOX fields on the Profile Pages
Pages: [1]

Author Topic: Requirement of having HIDDEN TEXT BOX fields on the Profile Pages  (Read 1622 times)

ashwanidher

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
Requirement of having HIDDEN TEXT BOX fields on the Profile Pages
December 09, 2010, 09:14:22 pm
All,

Is there a way of having HIDDEN TEXT BOX fields on the Profile Pages in CiviCRM?
We have a requirement to do so and I'm not finding any means to do so.

Please help.

Warm Regards,
Ashwani Dher

Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: Requirement of having HIDDEN TEXT BOX fields on the Profile Pages
December 09, 2010, 09:34:23 pm
By implementing hook_civicrm_buildForm,  you can easily add hidden field. (http://wiki.civicrm.org/confluence/display/CRMDOC32/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmbuildForm)

eg:
urhookname_civicrm_buildForm( $formName, &$form ) {
  // only for profile form
  if ( $formName == 'CRM_Profile_Form_Edit' ) {
         // add hidden element for every profile form with name as 'custom_element_name' and value as 'element_value'
        $form->addElement('hidden', 'custom_element_name',   'element_value' );
    }
}

Hope this will help you.

Rajan

ashwanidher

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
Re: Requirement of having HIDDEN TEXT BOX fields on the Profile Pages
December 11, 2010, 03:36:35 am
Rajan,

Thank-you again.

Finally I was able to add a Hidden Field.

Now I need some more help, how can I add a text heading to a Custom Field.
Like here:- http://dev.opendatacenteralliance.org/index.php?option=com_civicrm&view=Profiles&Itemid=57

I have added a custom radio button field named 'Opt-in to newsletter' here and want to add a Text heading just above this field below the 'Reason for Joining' textarea. I have even tried 'Field Pre Help' option within the 'Custom Fields' settings in the Admin but that is not working for me.

Please help.

Warm Regards,
Ashwani Dher

Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: Requirement of having HIDDEN TEXT BOX fields on the Profile Pages
December 12, 2010, 10:13:49 pm
ashwani,

If 'Field Pre Help' and 'Field Post Help' is not sufficient for your requirement, u need to modify template files for that profile (templates/CRM/Profile/Form/Dynamic.tpl) accordingly, using civicrm's custom templates feature <base url>civicrm/admin/setting/path&reset=1.
You may take help of the documentation http://wiki.civicrm.org/confluence/display/CRMDOC33/Customize+Built-in,+Profile,+Contribution+and+Event+Registration+Screens    
 
Rajan

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Requirement of having HIDDEN TEXT BOX fields on the Profile Pages

This forum was archived on 2017-11-26.