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 (Moderator: Dave Greenberg) »
  • Pre-checking group fields attached to CiviEvent
Pages: [1]

Author Topic: Pre-checking group fields attached to CiviEvent  (Read 617 times)

welly

  • I’m new here
  • *
  • Posts: 29
  • Karma: 2
  • CiviCRM version: 4.4
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
Pre-checking group fields attached to CiviEvent
February 11, 2014, 04:45:20 am
Hello Civicrm fans,

I've got a profile which is used on an Event. It has a group field that will let the user join a newsletter group when they submit an event registration form. All works - however, if they're already a member of the newsletter group and register for an event and submit the form without checking the newsletter group field, they're removed from that group. Not ideal. They have to check the newsletter group checkbox before submitting the form. I'd like to either have that checkbox pre-checked by default or, preferably, pre-checked if the logged in user is already a member of the group.

Can anyone give me any suggestions how I might go about this? For prechecking it by default, we can use some jquery but preferably it'd only be prechecked if the user is a member of that newsletter group.

Thanks,

welly

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Pre-checking group fields attached to CiviEvent
February 11, 2014, 06:30:36 am
This looks like a similar topic where he created a small drupal module to uncheck a default box: https://forum.civicrm.org/index.php?topic=30443.0. I think you could approach it the same way.

Guessing there's also a way to do it in Civi, but I don't have the answer on that.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Pre-checking group fields attached to CiviEvent
February 11, 2014, 07:25:11 am
A completely different approach would be to use a webform for the event reg. This would let you take full control of the form fields.
Try asking your question on the new CiviCRM help site.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Pre-checking group fields attached to CiviEvent
February 11, 2014, 10:24:16 am
If the user is logged in - I think the checkbox should default to checked if the user is in the group. If they're not logged in it seems quite tricky to detect whether they're already in the group (altho you could MAYBE use an api call to check this after they've entered an email address ?? ).
Protect your investment in CiviCRM by  becoming a Member!

welly

  • I’m new here
  • *
  • Posts: 29
  • Karma: 2
  • CiviCRM version: 4.4
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Pre-checking group fields attached to CiviEvent
February 14, 2014, 08:04:21 am
Actually further to this, users can't log in so unless they check the "subscribe to newsletter" checkbox, they're always going to be unsubscribed. Using Webforms isn't ideal because the client is adding new events all the time and they won't be happy about having to create the event essentially twice. I'll have to keep thinking on this one.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Pre-checking group fields attached to CiviEvent
February 14, 2014, 05:48:15 pm
Seems like pre-checking the box is not a bad thing. You're encouraging folks to signup / OR verifying that they are. And if they uncheck the box then it would seem that they really don't want to be subscribed (whether they were previously or not). An alternative would be to direct them via link on thank-you page to a separate profile w/ only the group field and make it a required field. Instructions on top tell them to submit it if they want to sign up for the newsletter. You could also redirect to the built in 'subscribe' form (e.g. https://civicrm.org/civicrm/mailing/subscribe). Neither option ideal since they may not click the link.

(You could also be more 'aggressive' and add any event participants to your newsletter group automatically via smart group criteria - but give them an opt-out option. Depends on who your constituents are etc. as to whether that would be acceptable or obnoxious.)
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Pre-checking group fields attached to CiviEvent

This forum was archived on 2017-11-26.