If i choose an option in the selectbox it be must fill a other textbox

Neptune

New Member
If i choose a meal than come the price not in the textbox. What i want is that if i choose an option in the selectbox that the texbox automatic fills with the price. \[code\]<!DOCTYPE html><?phpinclude ("connection.php");?><html><head><link rel="stylesheet" type="text/css" href="http://stackoverflow.com/questions/15804545/test.css"><meta charset="utf-8"><title>Kantine</title></head><body><div id="container"><div id="logo"></div><div id="header"><h1> Change or Delete meals</h1></div><div id="menu"></div><div id="content"> <?phpecho '<select name="Meals">';$result = mysqli_query($con,"SELECT meal, price FROM meals") ;while($row = $result->fetch_assoc()) { echo "<option value=http://stackoverflow.com/""."\">" . $row['meal']."</option>\n"; echo "<br />"; } echo '</select>'; echo '<input type="text" value="' . $row['price'] . '"/>'; mysqli_close($con);?> </div><div id="footer"></div></div></body></html> \[/code\]
 
Back
Top