how to handle 3 or more Select Box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • monomaldito
    New Member
    • May 2014
    • 1

    how to handle 3 or more Select Box

    hi everyone,
    i have a problem with select box, i need to create 3 select box, the first load the data from my DB created on mysql, that's work without problem.

    when i select on elemento from my list, i call a function created on javascript, that function get the id from my fisrt list and select every data related with the ID.

    my problem is when a clicked on my 2nd list i need to call another function in javascript who do exaclty the same that the first javascript function, the problem is that the second function doesn't get any information.

    i tested both MySQL querys and both work perfectly, anyone who can helpe me ??

    Code:
    // fillStage() this one works perfectly and show the information without problems
    
    function fillStage(){
    	var project = $("#project").val();
    	$.ajax({
    		url:'fill_stage_ajax.php',
    		data:{selected : project},
    		type:'POST',
    		success: function(data){
    			$("#stage").html(data);
    			} 
    		})
    	}
    
    ///this one doesn't work
    function fillActivity(){
    	var stage = $("#stage").val();
    	$.ajax({
    		url:'fill_activity_ajax.php',
    		data:{selected : stage},
    		type:'POST',
    		success: function(data){
    			$("#activity").html(data);
    			}
    		})
    	}
        </script>
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    there are too many unknowns to solve this.
    - what’s the according HTML code?
    - what’s the according PHP code?
    - what do the PHP scripts return (Dev tools, network tab)?

    also:
    - add an error listener to your ajax handle

    Comment

    Working...