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) »
  • How can one collect some information on homepage with completion on form page?
Pages: [1]

Author Topic: How can one collect some information on homepage with completion on form page?  (Read 1068 times)

admsh

  • I’m new here
  • *
  • Posts: 13
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.1.53
  • PHP version: 5.3.2
How can one collect some information on homepage with completion on form page?
September 01, 2011, 03:59:27 pm
Hope this will make sense - we're trying to build two action items on our homepage: a simple donation form, where an initial amount is already filled in, and an email collection field. In both cases, once the user hits submit, the next page should be the complete form - donation form will then have the amount that was entered on the homepage, newsletter signup will be populated with the email address, but other fields need to be completed (ZIP code is mandatory in our case).

The email collection form element looks like this:
Code: [Select]
<form  action="/civicrm/profile/edit" method="post" name="Edit" id="Edit" >
I've tried creating a simple form with the email field, changing the code above to the full path, but get an error. When I try to change "/civicrm/profile/edit" to "/civicrm/profile/edit?gid=13" (which is the ID of the form in question), I get to an empty form.

Any help would be greatly appreciated...

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: How can one collect some information on homepage with completion on form page?
September 01, 2011, 04:12:59 pm

I would probably do the foll:

1. On submit of the below, use a redirect to the profile or contribution form and send the entered form values as GET variables, thus:

civicrm/profile/edit?reset=1&gid=13&email=USER_ENTERED_EMAIL

2. Implement a hook that checks for the GET variable and then sets the default email / donation amount

You can potentially geenralize this code quite nicely so others can use it. Please publish your code so others can benefit

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

jhofer

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
  • CiviCRM version: 3.x
  • CMS version: Drupal 6.x
  • MySQL version: 5.x
  • PHP version: 5.x
Re: How can one collect some information on homepage with completion on form page?
February 19, 2012, 08:50:25 am
Did you get this to work? Would be helpful to see the code.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • How can one collect some information on homepage with completion on form page?

This forum was archived on 2017-11-26.