houssam_ballout Posted September 20, 2007 Share Posted September 20, 2007 Hello all,I'd the select control in html:<select name="CName" onchange="document.newVoucher.testing.value = '<?php //Here I want to take out the selected value from the list and then use it in a query how can I get the selected item in the combo box?Thanks in advance Link to comment Share on other sites More sharing options...
justsomeguy Posted September 20, 2007 Share Posted September 20, 2007 You can't run PHP like that onchange. That runs Javascript code, not PHP. If you want to use PHP to change something you will need to have Javascript use AJAX to send the request to PHP with the value of the element, PHP can do whatever it needs to do and return a result, and Javascript will need to get the result and update the page. Check the AJAX reference. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.