I need to dynamically change a forum based on a selection of a drop down menu. The forum will have a menu and two textboxes. All the information is in a Postgresql database, like so:
| Dropdown | Text1 | Text 2 |
---------------------------------
| 1 | red | blue |
| 2 | dog | cat |
This this choice_table. Now, in my HTML code I have put the following to figure out which choice has been selected:
<script>
$("#id_drop_down").on('change', function() {
if ($(this).val() !== ""){
$choice = $(this).val()
alert($choice + " has been selected!")
};
});
</script>
My next step is to use $choice to use as an identifier to query into the choice_table and populate Text1 and Text2. How can I use $choice to query my database?