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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Making the petition more ajax friendy
Pages: [1]

Author Topic: Making the petition more ajax friendy  (Read 646 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Making the petition more ajax friendy
March 29, 2011, 01:16:47 pm
using the ?snippet=1, we can already embed the sign up form in an iframe (so that's a widget that's easy to add).

However, the result is not ajax friendly (that's a full page with the decoration header bla bla).

I'm not sure what's the best option

1) modify the form so if ?snippet=1, the action is ?snippet=1 too
2) modify the petition result so if has the header x-requested-with (added by jquery on every ajax call), we know that's an ajax form and return ?snippet=1
3) have a mode json=1 that would return a json (is_error=1, values {id:xxx..}

What do you think ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

donquixote

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 3
  • CiviCRM version: none
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5.2
Re: Making the petition more ajax friendy
March 29, 2011, 02:03:51 pm
1) I think this is already the case, just the &snippet=1 has no effect on the result page.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Making the petition more ajax friendy

This forum was archived on 2017-11-26.