#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2007
    Posts
    46
    Rep Power
    8

    Chained Select Assistance


    Hi

    I managed to get the tutorial from the below link to work.
    http://www.blueicestudios.com/chained-select-boxes-using-php-mysql-ajax/comment-page-11/#comment-34199

    I would love to know how to edit this script so as to get the first dropdown to populate an already existing dropdown without the loader image and without the hiding of any dropdowns.

    I would assume that only this section needs editing:

    Javascript Code:
    $(document).ready(function() {
    	$('#wait_1').hide();
    	$('#drop_1').change(function() {
    		$('#wait_1').show();
    		$('#result_1').hide();
    		$.get("func.php", {
    			func: "drop_1", drop_var: $('#drop_1').val()
    		},
    		function(response) {
    			$('#result_1').fadeOut();
    			setTimeout("finishAjax('result_1', '"+escape(response)+"')", 400);
    		});
    		return false;
    	});
    });
     
    function finishAjax(id, response) {
    	$('#wait_1').hide();
    	$('#'+id).html(unescape(response));
    	$('#'+id).fadeIn();
    }

    Your assistance is greatly appreciated
    Last edited by Winters; November 7th, 2012 at 03:41 AM. Reason: Added some formatting.
  2. #2
  3. No Profile Picture
    Super Moderator
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,009
    Rep Power
    2791
    Moving to Javascript.
    [PHP] | [Perl] | [Python] | [Java] != [JavaScript] | [XML] | [C] | [C++] | [LUA] | [MySQL] | [FirebirdSQL] | [PostgreSQL] | [HTML] | [XHTML] | [CSS]

    W3Fools - A W3Schools Intervention.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2007
    Posts
    46
    Rep Power
    8
    Originally Posted by Winters
    Moving to Javascript.
    Many Thanks, my apologies for posting in the incorrect section,
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2007
    Posts
    46
    Rep Power
    8
    can any1 assist me with this?

IMN logo majestic logo threadwatch logo seochat tools logo