0
On the home page of my site I need to have two combobox for the user to select options coming from the database (for example: selects the state in the first combobox and when selecting the state in the second combobox the cities of this state are loaded. So far, ok.). I’m finding it difficult to do the following: After the user fills the two combobox (choose state and city), I need that on this same screen, below the combos, a text appears according to the options selected. This content will come from the bank and will be according to the status id and selected city id.
My select in HTML is populated and at each selected state a Javascript function calls a file called listingCidades.php which will fill the other combobox. Ok. How to get the status id and city id and query using these two information to bring content to the same home screen?
Put some existing code of the party in question, to facilitate the answer and better present your doubts. From what I understand you just want to get the id and status, this would give you to do with javascript to get the necessary id’s and using ajax to send to file called
listaCidades.php
, in this file you return a JSON and with JS you can dynamically assemble the text accordingly.– Guilherme Lopes
Friend, in this case I believe you have the complete information (state/city) after the user select a value in the city combobox is not even ? Then you can listen to the onchange event of the city combobox for when it is changed, make a request to the server passing the selected values of the two combobox. When you post your code it becomes easier to tell which changes you need to make.
– Silvio Lucena Junior