I have <select>
with several options, while selecting an option, I want the form to be submitted to the same page and I'll get the value per php on the same page. For this, I have the following:
<?php
if(isset($_POST['select_carros']))
{
echo $_POST['select_carros'];
}
?>
<form action="" method="post" name="menuForm">
<select name="select_carros">
<option value="1">Carro 1</option>
<option value="2">Carro 2</option>
<option value="3">Carro 3</option>
</select>
</form>
Basically, what I want is that when choosing the option the value of this option is printed. For example, I choose the option "Car 2" and it will be printed "2"