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) »
  • Adding Jquery lib files when the snippet 1 is used in URL for profiles
Pages: [1]

Author Topic: Adding Jquery lib files when the snippet 1 is used in URL for profiles  (Read 814 times)

sriraman.v

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.5.8
  • PHP version: 5.2.9
Adding Jquery lib files when the snippet 1 is used in URL for profiles
August 05, 2011, 06:24:58 am
hi ,

i have created a profile form for registration purpose with firstname ,last name , country and state dropdown. Country and State fields are done in ajax.ie Depending upon the country ,state will be displayed.

the below function is used

<script language="JavaScript" type="text/javascript">

cj(function()
{

        countryID       = "#country-Primary"
       stateProvinceID = "#state_province-Primary"
        callbackURL     = "/ru/civicrm/ajax/jqState"

   cj(countryID).chainSelect(stateProvinceID, callbackURL, null );
});

</script>


All above fields are configured using Custom fields.


i want to make use of the form for the inline purpose with no layout.
So i added the snippet=1 to existing URL civicrm/profile/create?gid=8&reset=1&snippet=1.

It removes the layout including  CSS and jquery lib files. the country and State Fields are not working as it depends upon ajax function .

These dropdown works fine when the snippet 1 is removed (which include jquery lib  and css files).

As a fix , i believe jquery lib files  need to be included to the page.

As the above fields used are custom fields ,i tried to include the Jquery lib files in the civicrm\templates\CRM\Form\Default.tpl page.It is affecting the other pages in CRM

My question is where to include the jquery lib files ,when the snippet 1 is used?

Can any one help me on this issue.

Regards,
Sriraman.V

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Adding Jquery lib files when the snippet 1 is used in URL for profiles
August 06, 2011, 05:33:03 am
Why are you not using standalone profile html code snippet?

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Adding Jquery lib files when the snippet 1 is used in URL for profiles

This forum was archived on 2017-11-26.