I have been looking at this code for probably 4 hours now trying to get it to do what I want. I want it so that when a new value is put in the dropdown menu the label below will update, but the information is coming from PHP though. How would I do this cause I have looked everywhere and I can't find something that would help. I think I saw somewhere that I can't do it like this with PHP since it is processed server side not client side, if that is true can you tell me what I am supposed to do?
<?php
echo "<script type='text/javascript'>
function updatePrice()
{
var x = document.getElementById('partNumber').value;
document.getElementById('price').innerHTML = 'HERE I AM ' + x;";
// $pricesql = "SELECT partPrice FROM Parts WHERE partID = "document.getElementById('partNumber').value;;
$priceresult = $pdo->query($pricesql);
echo "}
</script>";
?>