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) »
  • Auto Complete in html profile form
Pages: [1]

Author Topic: Auto Complete in html profile form  (Read 1926 times)

benjeewest

  • Guest
Auto Complete in html profile form
November 13, 2009, 06:54:26 am
Hi everyone-

I'm trying to set up an auto-complete field in an embeddable html form.

The code snippet which civicrm has given me is posted at
http://ukycc.org/test.html

but the JavaScript isn't working, apparently 'cj is not defined' on lines 36 and 247 and 'calendar' is not defined on 169.

I'm not good with JavaScript-would somebody be kind enough to point me in the right direction? Thanks!


>Ben

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Auto Complete in html profile form
November 13, 2009, 10:57:22 am
Hi Ben - Did you generate this using the "Standalone" Profile form feature (renamed to HTML Snippet in 3.0)? Looks like that form generator is not including some needed lines - which is a bug.

Try adding these lines to your test form (I think the url paths are correct for your site - but double check since some of your urls use http://act.ukycc.org/ and some use http://ukycc.org/):

Code: [Select]
<style type="text/css">@import url(http://act.ukycc.org/css/skins/aqua/theme.css);</style>
<script type="text/javascript" src="http://act.ukycc.org/js/calendar.js"></script>
<script type="text/javascript" src="http://act.ukycc.org/js/lang/calendar-lang.php?en_US"></script>
<script type="text/javascript" src="http://act.ukycc.org/js/calendar-setup.js"></script>

<script type="text/javascript">var cj = jQuery.noConflict(); $ = cj;</script>

I'll update this thread with the bug fix issue shortly - since I think we need to fix this for 3.0 and 3.1 ....

UPDATE: Bug fix issue for 3.1 and 3.0.3 is here: http://issues.civicrm.org/jira/browse/CRM-5390
« Last Edit: November 13, 2009, 11:10:50 am by Dave Greenberg »
Protect your investment in CiviCRM by  becoming a Member!

benjeewest

  • Guest
Re: Auto Complete in html profile form
December 02, 2009, 04:33:31 am
Hi Dave, Many thanks for the help.

It was indeed generated using the HTML snippet. I've added the lines you suggested to my test page

http://ukycc.org/test.html but the autocomplete still doesn't appear to be working?

Regarding url paths, the files reside under http://ukycc.org/ but due to an .htaccess trick with Wordpress MU, they can be accessed from either act.ukycc.org or ukycc.org.

Thanks once again!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Auto Complete in html profile form
December 02, 2009, 04:29:07 pm
Ben - The auto-complete field is not working in your test form because it's invoking a URL which requires 'access CiviCRM' permissions. We've discussed this internally and agreed that the restriction is not appropriate for this AJAX call. I've filed an issue and committed a fix which will be part of 3.0.3.

http://issues.civicrm.org/jira/browse/CRM-5480

If you want to try it now, you'll need to modify CRM/Core/xml/Menu/Contact.xml using this "diff":
http://fisheye2.atlassian.com/viewrep/CiviCRM/branches/v3.0/CRM/Core/xml/Menu/Contact.xml?r1=23658&r2=25347

... and then rebuild the CiviCRM menu by accessing this URL while logged in:
http://<your site>/civicrm/menu/rebuild?reset=1

While testing this fix, I also discovered another problem with using HTML Snippet profile forms for anonymous users. You'll need to modify the action parameter of the form in the HTML snippet. Find the form action in the HTML code:
Code: [Select]
<form  action="http://<your site>/civicrm/profile/edit&amp;gid=

... and replace 'edit' with 'create' so it looks like this:

Code: [Select]
<form  action="http://<your site>/civicrm/profile/create&amp;gid=

We've also fixed this for 3.0.3 (but changing it in your HTML Snippet is all you need to do):

http://issues.civicrm.org/jira/browse/CRM-5482
Protect your investment in CiviCRM by  becoming a Member!

benjeewest

  • Guest
Re: Auto Complete in html profile form
December 05, 2009, 01:50:17 pm
Hi Dave, I've implemented the fixes you reccomended and my test page now seems to be functional:
http://ukycc.org/test.html

However, the form doesn't yet seem to be working on my home page, but I'm not getting any javascript errors?
http://ukycc.org/

Thanks so much for all the help!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Auto Complete in html profile form
December 06, 2009, 02:49:03 pm
I'm still getting a "permission denied" error on the URL that the Ajax "Higher Education" lookup needs to access:

http://act.ukycc.org/standalone/index.php?q=civicrm/ajax/auto&reset=1&ogid=41&cfid=1

(and that field on your test page isn't working for me either).

If you followed all the steps including changing Contact.xml and doing the menu/rebuild (and got the "menu has been rebuilt" status message) - then I'm not sure what's up ???
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) »
  • Auto Complete in html profile form

This forum was archived on 2017-11-26.