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 CiviContribute (Moderator: Donald Lobo) »
  • Using jquery in custom Contribution (and other) Smarty based forms
Pages: [1]

Author Topic: Using jquery in custom Contribution (and other) Smarty based forms  (Read 430 times)

jrkelley32

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 0
Using jquery in custom Contribution (and other) Smarty based forms
October 14, 2013, 10:46:12 am
When I upgraded to 4.3.5 from an old release of CiviCRM jquery in Smarty custom forms broke.  I've seen that in previous release of Civi patches were issued to address the problem.  Are there any workarounds to allowing Civi jquery libraby calls in custom smarty forms and if not what plans are there for support of making such calls?  Thanks!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Using jquery in custom Contribution (and other) Smarty based forms
October 14, 2013, 12:04:16 pm
Hi,

jquery works fine on custom templates. However, the underlying assumptions on your old code about what was where in the html code are most probably not correct anymore and the html code has probably changed quite a fair bit.

You are the one having the knowledge of what it did, I'm afraid you'll have to dig back in the code and see what it does(n't) do with the new version. Fortunately, the js debuggers are pretty decent, so shouldn't be too hard to trace.
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

jrkelley32

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 0
Re: Using jquery in custom Contribution (and other) Smarty based forms
October 14, 2013, 12:39:25 pm
I created a new Contribution page (a copy of an old one), then copied the generic Main.tpl into the designated custom folder, and when I select a Country it is not switching to the appropriate state/Province list.  When I load the page I get cj is not defined for the piece of code that would normally to the country/State/Province switching.  When I go into civi and do a "view live page" it works fine.

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Using jquery in custom Contribution (and other) Smarty based forms
October 18, 2013, 06:45:59 am
I'm not sure if this is the right place for this (I'm not using a custom template), but I'm trying to use contributions for different countries for the first time and I notice the State/Provinces list does not change when the country is selected.

Things work OK on the demo site, which is 4.4 - I'm using 4.3.7, the latest stable release.

UPDATE: I'm using a profile for the contribution page and I found the following:

http://forum.civicrm.org/index.php/topic,16815.msg71827.html#msg71827

The user says he/she solved the problem by placing the Country field above the State/Province field, but this is not working for me - all states for all countries appear in every case.

Amy ideas? Thanks...
« Last Edit: October 18, 2013, 07:08:03 am by bcobin »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Using jquery in custom Contribution (and other) Smarty based forms

This forum was archived on 2017-11-26.