Here’s my code: ($uweeks is an array of numbers)
<form action = "" method = "post">
<select name="weekdrop"><option value="Weeks">Choose a Week</option>
<?php
for($x=0; $x < $uwsize; $x++) {
echo "<option value= ". $uweeks[$x] ." >" . $uweeks[$x] . "</option>";
}?>
</select>
</form>
What I want to do is when someone choose one of the numbers in the drop down, to echo the number on that same page. Is this possible?
Change the
<select/>tag to this:Then print this where you want the text to appear:
That’s how you can do it using JavaScript (along with PHP to produce your content). All dynamic changes for which you do not want to require the user to make a complete page reload, require JavaScript.