Results 1 to 2 of 2

Thread: Change distance slider to dropdown?

  1. #1
    Thread Starter
    Expired Customer synergysquad's Avatar
    Join Date
    Dec 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change distance slider to dropdown?

    I have tried to find information through forum searches and through the documentation but cannot find anything to help me solve the issue I am currently having.

    A client has asked that I change the "distance slider" into a "distance dropdown". I attempted to do this by just adding in a simple dropdown and going from there with javascript doing nearly the same thing that the slider was doing on the select change. Taking the value of the select option and putting it as the value of the input with the id of distance.

    The jQuery looks like this

    Code:
    jQuery('input#distance').attr('value', jQuery('#dist-dropdown').val());
    
    jQuery('#dist-dropdown').change(function() {
         var distance = jQuery('#dist-dropdown option:selected').val();
         jQuery('input#distance').attr('value', distance);
    });
    And the HTML like this.

    Code:
    <input type="text" id="distance" name="distance" />
    <div id="dist-dd">
    	<select name="dist-dropdown" id="dist-dropdown">
    		<option value="10">10 Miles</option>
    		<option value="25">25 Miles</option>
    		<option value="50">50 Miles</option>
    		<option value="75">75 Miles</option>
    		<option value="100">100 Miles</option>
    		<option value="200">200 Miles</option>
    		<option value="300">300 Miles</option>
    		<option value="500">500 Miles</option>
    		<option value="99999">Any Distance</option>
    	</select>
    </div>
    When I try to add in an alert for the select change it does not fire. I do not understand why? Has anyone done this previously and if so can I get some direction in either doing so or fixing the issue I have?

    Thank you

  2. #2
    Thread Starter
    Expired Customer synergysquad's Avatar
    Join Date
    Dec 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Can you set the default distance slider distance to something smaller than 50km
    By shunarjuna in forum Vantage General Discussion (Legacy)
    Replies: 8
    Last Post: September 11th, 2015, 12:55 PM
  2. Edit distance slider text?
    By xindex in forum Vantage General Discussion (Legacy)
    Replies: 0
    Last Post: April 7th, 2015, 09:18 AM
  3. Refine distance slider not appearing
    By clearspark in forum Vantage General Discussion (Legacy)
    Replies: 2
    Last Post: April 14th, 2014, 08:24 PM
  4. Samcy Distance slider
    By jikanv in forum Help Using ClassiPress
    Replies: 3
    Last Post: May 15th, 2013, 05:23 AM
  5. Distance slider
    By tbase in forum Vantage General Discussion (Legacy)
    Replies: 0
    Last Post: March 12th, 2013, 06:43 PM