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) »
  • Allow users to add items to a select list?
Pages: [1]

Author Topic: Allow users to add items to a select list?  (Read 593 times)

erogers

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 0
  • CiviCRM version: 4.6.2
  • CMS version: Wordpress 4.1
  • MySQL version: 5
  • PHP version: 5
Allow users to add items to a select list?
December 27, 2011, 08:55:24 am
Here is my use case: An event registration page where users pick a team to join, or create a new team to add to the select list.

I tried using CiviCRM webform integration so allow users to create new teams, with the form adding a CiviCRM custom fieldset and profile.  The team name is a text field for data entry, but d I can't get that to render as select field when I use it in the event registration page.

What is the best way to accomplish this?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Allow users to add items to a select list?
December 27, 2011, 10:07:33 am
I don't think I have enough info about what you're trying to do to tell you the "best way." Is a team an organization? Or is it just a custom textfield? Are you doing event reg within the webform?
The webform "select or other" module might be helpful to you.
You can replace a textfield with a select by deleting the textfield component, then adding a select component with exactly the same form key.
Try asking your question on the new CiviCRM help site.

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: Allow users to add items to a select list?
December 27, 2011, 06:09:23 pm

You can potentially do that via a hook. Check:

http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmcustomFieldOptions

and use that hook to populate the select box. Note that since you are using a Text field there will be issues of duplicates etc, so you might want to implement a validate hook in the webform to ensure all teams have unique names

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) »
  • Allow users to add items to a select list?

This forum was archived on 2017-11-26.