Not able to get value from select element. (PHP/HTML) -
i'm trying value of drop down menu. drop down menu created after user clicks button with undrafted players
. however, when echo selectoptionud
, not value. idea what's going on here?
<html> <body> <?php if (isset($_post['submitundrafted'])) { $selectoptionud = $_post['filter_ud']; //undrafted selection echo $selectoptionud; }//end of submitundrafted if (isset($_post['undrafted'])) { $menu= "<select name='filter_ud' id='filter_ud'> " . $options . " //i have erased previous code gets value of variable. </select>"; echo $menu; ?> <form action="transfer.php" method="post"> <input type="submit" name="submitundrafted" value="submit" /> </form> <?php } ?> <form action="transfer.php" method="post"> <input type="submit" name="undrafted" value="with undrafted players"> </form> </body> </html>
here $options
this
<option value="1">abc</option> <option value="2">bcd</option> <option value="3">def</option> if (isset($_post['undrafted'])) { $menu= "<select name='filter_ud' id='filter_ud'> " . $options . " //i have erased previous code gets value of variable. </select>"; ?> <form action="transfer.php" method="post"> <?php echo $menu;?> <input type="submit" name="submitundrafted" value="submit" /> </form> <?php }?>
Comments
Post a Comment