function proceed($mapType){ switch($mapType) { case "showevent" : $("#dropdowns").attr("action", showEvent.html); $("#dropdowns").submit(); window.location.replace("showEvent.html"); break; case "addplace" : $("#dropdowns").attr("action", addPlace.html); $("#dropdowns").submit(); window.location.replace("addPlace.html");break; case "addevent" : $("#dropdowns").attr("action",map.html); $("#dropdowns").submit(); window.location.replace("map.html");break;
here's javascript
and here is html
<input type="button" value="add a place" id="addplace" onclick="proceed(addplace)" /> <input type="button" value="add an event" id="addevent" onclick="proceed(addevent)" /> <input type="button" value="show event" id="showevent" onclick="proceed(showevent)" />
what I want is to post dropdowns form ( form consisting of 4 dropdown lists) to diffenrent page - according to button clicked and redirect to that page after that