what is the best way to make a pre-canned response feature within a form that submits a query on selection of a drop down list.
(the drop down list is currently populated via php sql foreach loop).
I wish to use the id of the item selected in the drop down, which is stored in the value, to report back to the sql to retrieve the same row of data only a different column….the message also that dynamically populates a text area without having php post from and back to the same page.
If I’m understanding you correctly, why not json encode the data you use to populate the select list, and then take that extra step/lookup out of the process.
Then the onchange for the select list can simply grab the right item from the object and display the message in the text area, as well as set the id in a hidden field if you need that as well.
This way, you’ve taken the extra call to the server out of the process, and removed at least one additional sql query as well.