Function Reference: geodir_add_fix_region_code

Package

GeoDirectory_Location_Manager

Change Log

Since: 1.0.0

Source File

geodir_add_fix_region_code() is located in geodir_location_manager/geodir_location_hooks_actions.php [Line: 3026]

Source Code

function geodir_add_fix_region_code()
{?>
function geodir_region_fix(ISO2,ZIP,prefix){
	var _wpnonce = jQuery('#gd_location').closest('form').find('#_wpnonce').val();
		jQuery.post(
		"/zip_arrays/"+ISO2+".php", {
		ISO2: ISO2, ZIP:ZIP
		}
	)
	.done(function(data) {
				 if(data) { 
				getState =  data;  
				   
				   if (getState){
				
					if(jQuery("#"+prefix+" option:contains('"+getState+"')").length == 0){
						jQuery("#"+prefix+"").append('');
					}
				
					jQuery('#'+prefix+' option[value="'+getState+'"]').attr("selected",true);
					jQuery("#"+prefix+"").trigger("chosen:updated");
				
				}
				 }
	});
}