Forum Moderators: coopster
<fieldset><legend>Search for Collection Nodes</legend>
<form action="eq2Collect.php" method="post">
<?php
$zones = array (1 => 'Antonica', 'Barren Sky', 'Blackburrow')
echo '<select name="zoneSearch">';
foreach ($zones as $key => $value) {
echo "<option value=\"$key\"> $value </option>\n";
}
echo '</select>';
?>
<input type="submit" name="submitSearch" value="Search Zone for Nodes" />
<input type="hidden" name="submittedSearch" value="TRUE" />
</form>
</fieldset><br />
Ok, so I get the drop down box, and the button.
How do I go about getting text to appear somewhere on my page that would say something like;
"You selected zone Commonlands"
when the submit button is pressed? Essentially, I don't know how to get the item in the drop down list that has been selected before the submit button is pressed.
I've tried many variations of;
if(isset($_POST['submittedSearch'])){
echo $_get['zoneSearch'];
}
echo $_POST['zoneSearch'];
simply causes the index number to whatever selection in this list to be outputted(echoed) onto the web page.
I'm going to try to figure it out, but in case I have no luck I'd thought that I would reply here first.