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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Prepopulate profile standalone form
Pages: [1]

Author Topic: Prepopulate profile standalone form  (Read 1281 times)

unclejustin

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 2
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.3.6
Prepopulate profile standalone form
June 30, 2008, 10:53:35 pm
I have a simple survey type form I want to put on the home page that asks a couple questions from the user. After the user submits the form it saves the information just fine, and I can see it in the contact record, but I want their answers to show up on the form when they come back to that page in the future.

For example if I have a question "Do you prefer A or B" and they select "B" then I want "B" to be the selected radio button when they come back.

Is this possible?

Thanks,
-justin
-justin

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Prepopulate profile standalone form
July 01, 2008, 09:41:39 am
You can do this for logged in (authenticated) users. Point them to the same Profile form in "edit" mode and it will bring back the saved values.

EXAMPLE: If your profile ID is 3... (using Drupal with clean url's)

http://<your_site>/civicrm/profile/edit?gid=3&reset=1

If you're using Drupal, you can also embed your profile form in the Drupal "My Account" page by checking "Used For" = View/Edit User Account. Saved values will be defaulted in this case as well.

(For "anonymous" browsers there's some "experimental" code that allows you to email them a link w/ a temporary "hash" that authenticates them - but since this requires clicking from an email message link it may not fit your needs.)
Protect your investment in CiviCRM by  becoming a Member!

unclejustin

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 2
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: Prepopulate profile standalone form
July 01, 2008, 10:11:43 am
Thanks Dave! This is for authenticated only, I'll give it a shot.
-justin

unclejustin

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 2
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: Prepopulate profile standalone form
July 01, 2008, 11:16:50 am
Hmm, still not working out the way I want it to.

I'm pasting the stand alone code into a new node which I'm using for the homepage for authenticated users.

I want the radio button to be selected with whatever they selected last time they were here, I see now (duh) that because the form is just raw html that won't work. I'll need to override this somehow with their selections if available.

Any help would be greatly appreciated, but it really looks like I need to build something from scratch to make this happen.

-justin
-justin

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Prepopulate profile standalone form
July 01, 2008, 11:42:59 am
You'll need to use the "built-in" version of your profile form - not the "standalone" method... (see the sample URL in my earlier post).
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Prepopulate profile standalone form

This forum was archived on 2017-11-26.