Page 1 of 1

(Company Directory) Lookup Coordinates Button Missing

Posted: Mon Sep 29, 2014 3:04 am
by inyerface
The Lookup Coordinates button that is missing is specifically related to the "Frontend Edit Company Template". I just realized that it doesn't work from the admin panel either. Everything has been updated to the latest version and default templates reset.

CMSMS 1.11.11
Company Directory 1.22.6
CGExtensions 1.42.2
CGSimpleSmarty 1.7.4
JQueryTools 1.2.6

The script looks like this:

Code: Select all

{cge_have_module m='CGGoogleMaps' assign='tmp'}
{if $tmp}
<__script__ type="text/javascript">{jsmin}
var geocodeurl  = '{module_action_link module='CGGoogleMaps' action='getgeocode' urlonly=1}' + '&showtemplate=false';
{literal}
$(document).ready(function(){
 $('#lookupgoeshere').html('<input type="submit" id="lookup" name="lookup" value="{/literal}{$CompanyDirectory->Lang('lookup')}{literal}"/>');
 $('#lookup').live('click',function(e){
  var address = $('#address').val();
  if( address != '' ) {
    var url = geocodeurl.replace(/amp;/g,'');
    var lat = 0;
    var long = 0;
    $.post(url, 'cntnt01address='+address,
      function(data) { 
        if( data.status == 'success' ) {
          lat = data.lat; long=data.lon;
          $('#latitude').val(lat);
          $('#longitude').val(long);
        }
      }
      , "json" );
  }
  return false;
 });
});
{/literal}{/jsmin}</__script>
{/if}
Then in the template, the HTML is:

Code: Select all

<input type="text" id="address" name="{$actionid}cd_address" value="{$the_company->address}" size="30"/>
    &nbsp;
    <span id="lookupgoeshere"></span>
Am I missing something?