The option choosen by the user from select box, it have to be send to the desired php file (getStatus.php) may be with get method or post method
but without using form submit button
<select name="status">
<option value="step_1">step_1</option>
<option value="step_2">step_2</option>
<option value="step_3">step_3</option>
</select>
<a href="getStatus.php"> Go </a>
You will have a var called $_POST['status']
or $_GET['status']
with the value equal to the value of the selected option
. Without more code that's about all I can tell you.
EDIT: This will need to be made in a form
with the action
attribute set to getStatus.php
and preferably a method of POST
. There will not be any way around using a form if you want to pass data to another page unless you pass the data with AJAX. Why are forms not an option?
use javascript
for this :-
<select name="status" id="myselect">
<option value="step_1">step_1</option>
<option value="step_2">step_2</option>
<option value="step_3">step_3</option>
</select>
<a href="#" onclick="click_me()"> Go </a>
<script>
function click_me(){
var selects = document.getElementById("myselect");
var selectedValue = selects.options[selects.selectedIndex].value;// will gives u 2
var selectedText = selects.options[selects.selectedIndex].text;// gives u value2
window.location = "getStatus.php?id="+selectedText;
}
</script>
<select name="status" id="status">
<option value="step_1">step_1</option>
<option value="step_2">step_2</option>
<option value="step_3">step_3</option>
</select>
<a href="#" onclick="getitem()"> Go </a>
<script>
function getitem(){
var item = document.getElementById('status').value;
location.href="getStatus.php?id="+item;
}
</script>