Fieldtype

Archived
Forum
(read-only)

Google Latlng Lookup

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From No Two The Same

     

If empty ignore

Bug Report

Creative Lynx
Creative Lynx

Hi Elliot

I’ve just done a modification to the validation so that if you leave the fields empty then the validation doesn’t kick in.

function validate($data{
  
  $lat 
$this->EE->input->post($this->prefix.'latitude'TRUE);
  
$lng $this->EE->input->post($this->prefix.'longitude'TRUE);
  
  if( !empty(
$lat) || !empty($lng) ){
   
if(!is_numeric($lat) || !is_numeric($lng) ) {//Latitude and Longitude must be numbers
    
return 'Latitude and Longitude must be numbers';
   
}   
  }
  
  
return TRUE;
  
 
Elliot Lewis
# 1
Developer
Elliot Lewis

Thanks. I’ve folded the change in to the latest version.
(Sorry about the late reply, I’ve only just had an email from another support request and seen this.)