I have a drop-down select menu which I'll want to use to return the value of a variable without a submit button and no page reloads. Index.html
<form action="fetch" method="get">
<p>
<select name="POS">
<option>SELECT COURSE</option>
<option value="POS">Agricultural Economics and Extension</option>
<option value="A">Another</option>
</select>
</p>
<p>
<input type="submit" name="check" id="check" value="Submit">
</p>
</form>
PHP Page
if(isset($_GET['check'])){
$POS = 'Agricultural Economics and Extension';
$CC = 'English, Mathematics, Chemistry';
$CO = 'Either Biology or Agricultural Science';
$OS = 'Any one of Physics, Geography and Economics';
}
Let the value of the drop down example
<option value="POS">Agricultural Economics and Extension</option>
Return the defined value in PHP without reloading the page.
$POS = 'Agricultural Economics and Extension';