Reputation: 11
I am trying to get drop down select value posted upon send.
Markup
<select name="taskOption">
<option value="1">First</option>
<option value="2">Second</option>
<option value="3">Third</option>
</select>
php
$selectOption = $_POST['taskOption'];
{
$message.=$value.'<br>';
}
$message.='
What am I doing wrong?
Upvotes: 0
Views: 804
Reputation: 16122
you need to use post
in your form
, method="post"
if(isset($_POST['submit'])){
$dropdwon = $_POST['taskOption'];
//code here
}
Upvotes: 0
Reputation: 101
Is this what you're trying to do?
if(!empty($_POST['taskOption']))
{
$value = $_POST['taskOption'];
$message.=$value.'<br>';
}
Upvotes: 2