I have a form where I have two combo boxes, one is category
and other one is city
. According to what I select from category
, I need to go to different pages and I achieved that task as shown below.
ex: If I select Cars
in category
I need to go to Cars.html
. If I select Motorbikes & Scooters
I need to go to Motorbikes&Scooters.html
:
<form action="<?php $_SERVER["PHP_SELF"]; ?>" method="post" name="myform1">
<tr>
<td>
<label name="category">Category</label>
</td>
<td>
<select id="place" name="Category">
<option value="select">Please select a Category</option>
<option value="Cars">Cars</option>
<option value="Motorbikes & Scooters">Motorbikes and Scooters</option>
<option value="Three Wheelers">Three Wheelers</option>
<option value="Vans & Busses">Vans and Busses</option>
<option value="Heavy-Duty vehicles">Heavy-Duty vehicles</option>
</select>
</td>
</tr>
<tr>
<td>
<label name="City">City</label>
</td>
<td>
<input type="text" id="textbox1" name="city">
</td>
<td>
</form>
<script>
document.getElementById('goTo').onclick = function(e){
e.preventDefault();
var yourPath = "",
yourPage = document.getElementById('place').value;
extension = '.html';
window.location = yourPath + yourPage + extension;
}
</script>
My question is after this I need to pass selected condition
and city
to Cars.html
or Motorbikes&Scooters.html
etc. page (according to what is selected in combo box). How can I do this?