By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

how to handle 3 or more Select Box

P: 1
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 ??

Expand|Select|Wrap|Line Numbers
  1.  
  2. // fillStage() this one works perfectly and show the information without problems
  3.  
  4. function fillStage(){
  5.     var project = $("#project").val();
  6.     $.ajax({
  7.         url:'fill_stage_ajax.php',
  8.         data:{selected : project},
  9.         type:'POST',
  10.         success: function(data){
  11.             $("#stage").html(data);
  12.             } 
  13.         })
  14.     }
  15.  
  16. ///this one doesn't work
  17. function fillActivity(){
  18.     var stage = $("#stage").val();
  19.     $.ajax({
  20.         url:'fill_activity_ajax.php',
  21.         data:{selected : stage},
  22.         type:'POST',
  23.         success: function(data){
  24.             $("#activity").html(data);
  25.             }
  26.         })
  27.     }
  28.     </script>
  29.  
May 6 '14 #1
Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
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
May 7 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.