<script type="text/javascript"> /* <![CDATA[ */ jQuery.noConflict(); (function($) { <?php get_template_part('includes/countries'); ?> var availableCountries = [ <?php global $countries; $countries_array = array(); if ($countries) foreach ($countries as $code=>$country) { $countries_array[] = '"'.$country.'"'; } echo implode(',', $countries_array); ?> ]; var availableStates = [ <?php global $states; echo implode(',', $states); ?> ]; $("input#job_country").autocomplete({ source: availableCountries, minLength: 2 }); $("input#job_city").autocomplete({ source: availableStates, minLength: 1, search: function(){ var c_val = $("input#job_country").val(); if (c_val=='United States' || c_val.val()=='USA' || c_val=='US') return true; else return false; } }); $("#submit_form").submit(function() { $('input#job_city, input#job_country').removeAttr('autocomplete'); }); })(jQuery); /* ]]> */ </script>
There are currently 1 users browsing this thread. (0 members and 1 guests)