Display data from BD as you select a select option

Asked

Viewed 39 times

0

I have a system where the user will register the information as below:

inserir a descrição da imagem aqui

Note that the registration includes suppliers. This data will appear in another form as below:

inserir a descrição da imagem aqui

I would like the user when selecting one of the suppliers, appeared only the information relating to it lives of the comic. My doubt is in Jquery or Javascript and not in programming, since the registration is already being done, just this view.

From the static form I have this code:

$(document).ready(function(){   
  $('#select').on('change',function(){    
    var valor = '#'+$(this).val();    
    $('#pai').children('div').hide();    
    $('#pai').childrenvalor).show();   
  });  
});

But how I would do it dynamically?

  • but if the doubt is in javascript, ask the question your code javascript to be able to see, otherwise the answer would be "yes, it is possible to filter with javascript"

  • So Ricardo, if I had the javascript code, I wouldn’t be here posting my question.

  • then want a javascript code ready to make the filter, that’s it?

  • Ricardo, I don’t have much experience with jquery or javascript. The code I have and use is this: $(document).ready(function(){
 $('#select').on('change',function(){
 var valor = '#'+$(this).val();
 $('#pai').children('div').hide();
 $('#pai').childrenvalor).show();
 });
});, but dynamically accurate with values coming from the BD as selected options.

  • I think I understood, below this select has a list with several suppliers (li, table, etc), and want to hide and show only the selected, is this?

  • This. However, it is dynamic data, that is, the BD information related to each supplier will come. In a static way I know how to do, my difficulty is because it is dynamic.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.