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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Populating custom field with calculated value
Pages: [1]

Author Topic: Populating custom field with calculated value  (Read 1343 times)

rguerra

  • Guest
Populating custom field with calculated value
August 09, 2007, 07:28:13 am
I am developing a event registration site for a client using CiviCRM, specifically the CiviEvent functionality.

I have been able to implement all of the desired specifications easily so far, well except one.. that being the desired functionality of a custom field called "Badge Name" .

As the name would suggest, the field contains the text the user wishes to appear on his/her badge when then arrive at the conference and pick up their registration materials.

The functionality i'd like to add is as follows -

- to have the "badge name" field have a  default value based on Name entered (ie. first name + initial + last name).
- The user could change the value, which would be saved when the form is submitted.

ie.
First Name: John
Last Name: Doe
Badge Name: John Doe (editable)

I have searched to see how to tweak the existing smarty templates to see how this could be done, but haven't quite figured it out.

I would appreciate any help - be it comments, advice or offers of help to get this feature implemented ASAP.


regards

Robert

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: Populating custom field with calculated value
August 09, 2007, 12:02:25 pm

One potential solution is:

hack the template to add a custom javascript function to the custom field 'badge name' that enters its iinitial value from the first/last name. You might also want to add javascript to the first/last fields to update badge name if not manually modified

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

rguerra

  • Guest
Re: Populating custom field with calculated value
August 09, 2007, 06:36:45 pm
hacking the template - how? I'm not a coder. Something simple to do? is there an example somewhere that i could look at.


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: Populating custom field with calculated value
August 09, 2007, 06:47:48 pm

sorry, on a bit more thought, thats not a simple thing to do either, since u'll need to insert the javascript into the html form element (which u cannot do via modifying the template). I was hoping u could do a similar trick to:

http://wiki.civicrm.org/confluence/display/CRMDOC/Displaying+signup+email+within+profile

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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Populating custom field with calculated value

This forum was archived on 2017-11-26.