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) »
  • Split profile over 3 pages in drupal
Pages: [1]

Author Topic: Split profile over 3 pages in drupal  (Read 958 times)

laidback

  • I’m new here
  • *
  • Posts: 22
  • Karma: 0
  • Always looking for answers, so I can share it.
  • CiviCRM version: 3.3.5, 4.0.7,4.0.84.1
  • CMS version: Drupal 6, Drupal 7 and Joomla 1.6
  • MySQL version: 5.1.58
  • PHP version: 3.4.7.1
Split profile over 3 pages in drupal
March 09, 2011, 04:06:26 am
Hi I'm trying to display a profile I created over three pages. What I want is to be able to fill in say my details, on one page click next then enter some more details on the next page for example information about another person. I would like to only be able to click submit on the final page.

Hope this makes sense any help appreciated.

xcf33

  • I post frequently
  • ***
  • Posts: 181
  • Karma: 7
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.19/6.20
  • MySQL version: 5.x
  • PHP version: 5.2.6
Re: Split profile over 3 pages in drupal
March 09, 2011, 06:41:55 am
Hi,

It is possible,

what you would need to do is the following:

1. Split the form into 3 sections.
2. Create custom form submission handler that passes the information from the 1st step to the 2nd step (using GET or POST method)
3. On the second step, you should still have all the fields from the first step so those fields can retain the information passed from the first step (but they can be hidden fields).
4. Same thing on the third step you will need to have the all the fields for the profile form and fields from step1 and step2 would be hidden.
5. The final step is where the form action actually goes and submits to the profile form submission handler.


The only other challenge for you would be that you have to create custom client side javascript validation because at any step of the multi-step process if validation is required it will push the user to the entire form on the CiviCRM side.



Hope any of those make sense. If not it just means it is possible but requires some work.



Cheers!

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Split profile over 3 pages in drupal
March 09, 2011, 10:37:43 am
A third option which avoids coding is to use Webform. Thanks to colemanw's module, this is pretty straightforward for fields pertaining to Contacts.

http://civicrm.org/blogs/colemanw/civicrm-and-webform-module-together-last

Basically you create a webform, turn on the civicrm option, select the fields you want to show in the webform, then configure those fields via webform if you don't like the way they come through natively (eg change label, options etc)

Then you can use Webform to put in page breaks.

But it gets better (I should blog on this) you can also use the Conditional Webform module (yes they are arguing over the approach but it worked for me)

http://drupal.org/project/webform_conditional

And thereby hide fields so that they only show based on the value in a previous field, eg set Gender, and then 'if male show this set of fields, if female show this set'

The other advantage from Webform is that you can let the user submit the form at any point, and continue at a later time.

Oh and I forgot to emphasise that any data pertaining to civicrm fields is pushed in to civicrm - and if the person is logged in then of course the fields are pre-filled.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Split profile over 3 pages in drupal
March 17, 2011, 12:56:28 pm
Thanks for spreading the good word, Pete.
I'd love to see your blog entry about your use of webform_civicrm  ;D
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Split profile over 3 pages in drupal

This forum was archived on 2017-11-26.