I have a dropdown list and when when user selects a value and a different forms will appear depends on what the selected value. My file is in html. I'm using bootstrap for my design.
here is my sample code:
<form name="exmType" method = "POST">
<select class="form-control" name="txtType" class="select" method = "post"
onChange="this.form.submit();" style="width:300px;">
<option value="">Option A</option>
<option value="1">Option B</option>
<option value="2">Option C </option>
<?php
if (isset($_POST['txtType'])) {
if ( $_POST['txtType'] == "" ){
*display form a*
} elseif ( $_POST['txtType'] == 1 ){
*display form b*
} elseif ( $_POST['txtType'] == 2 ){
*display form c*
}
}
?>
</select>
</form>