Results 1 to 2 of 2

Thread: Adding a location field to jobroller

  1. #1
    Thread Starter
    Expired Customer shnalla's Avatar
    Join Date
    Jul 2012
    Location
    France
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Adding a location field to jobroller

    Hi,

    I am using Jobroller in an unusual way. I want to add a second location field to the job submission form.
    The idea is to show a driving direction just like the one on google map. (start address > end address)

    In submit-job-form.php there is a small piece of javascript code and I don't know how to tweak it to fit my needs :

    Code:
    <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>

  2. #2
    Veteran barukar's Avatar
    Join Date
    Sep 2010
    Location
    Brasil, São Paulo, SP
    Posts
    6,785
    Thanks
    186
    Thanked 742 Times in 623 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    -------------------------------------------------------------------------------------------
    Projects: ClassiNoiva - Classimóveis - vocênoenem - i50 - Clube DETRAN

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: December 3rd, 2011, 02:10 PM
  2. Adding City/Location
    By miamishade in forum Report ClassiPress Bugs
    Replies: 4
    Last Post: May 28th, 2011, 09:07 AM
  3. Adding the sellers location to the Title of your Ad.
    By dschn1978 in forum ClassiPress General Discussion
    Replies: 1
    Last Post: July 10th, 2010, 05:25 PM