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 Joomla Extensions (Moderator: lcdweb) »
  • autocomplete for onbehalf organisations
Pages: [1]

Author Topic: autocomplete for onbehalf organisations  (Read 1115 times)

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
autocomplete for onbehalf organisations
April 25, 2012, 08:41:22 am
Been trying to get auto complete to work on membership forms with 'onbehalf' option selected.
Joomla 2.5.4
Civi 4.1.1

All the docs found reference the ajax call with what look like drupal specific path?
eg
{crmURL p='civicrm/ajax/rest?fnName=civicrm/contact/search&json=1&contact_type=Organization&return[sort_name]=1&group=4&return[country]'}"{literal};

Q1. I am assuming that there is a folder called 'civicrm/ajax' in drupal - but not in Joomla. Is this right? Would seem to only function thru admin url? AM i missing something? Direct call thru Joomla front end just goes to 404

Q2. Code for autocomplete seems to exist already but seems switched off
Code: [Select]
var orgOption = '';
cj( "input:radio[name='org_option']" ).click( function( ) {
   orgOption = cj( "input:radio[name='org_option']:checked" ).val( );
   selectCreateOrg( orgOption, true );
});

function selectCreateOrg( orgOption, reset )
{
    if ( orgOption == 0 ) {
        cj( "div#id-onbehalf-orgname-help").show( );
        var dataUrl = "";
        cj( '#onbehalf_organization_name' ).autocomplete( dataUrl,
                                                          { width         : 180,
                                                          selectFirst   : false,
                                                          matchContains : true
        }).result( function( event, data, formatted ) {
            cj('#onbehalf_organization_name').val( data[0] );
            cj('#onbehalfof_id').val( data[1] );
            setLocationDetails( data[1] );
        });
    } else if ( orgOption == 1 ) {
        cj( "input#onbehalf_organization_name" ).removeClass( 'ac_input' ).unautocomplete( );
        cj( "div#id-onbehalf-orgname-help").hide( );
    }

    if ( reset ) {
        resetValues( false );
    }
}


       cj( "#orgOptions" ).show( );
       var orgOption = cj( "input:radio[name=org_option]:checked" ).val( );
       selectCreateOrg( orgOption, false );


Q3. OnBehalf.extra.tpl  - we have a custom OnBehalf tplbut the extra doesnt get picked up....was trying to add custom jquery to this to manipulate the dom/specify autocomplete for field  'onbehalf_organization_name'

Any answers / postcards etc :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Joomla Extensions (Moderator: lcdweb) »
  • autocomplete for onbehalf organisations

This forum was archived on 2017-11-26.