I need to add a select option form in the slider revolution slide WordPress, from where users can select a city and press Submit. On submission, it will open a URL link of that city.
Image with Select form
City Selected and Submitted Then it will open that city link
The code i need to work is Below:
<form class="form form-inline" id="link">
<div>
<select class="button-46 " style=" padding: 14px 14px;">
<option disabled selected hidden style="width: max-content;">Select city</option>
<option style=" background-color: black; " value="http://google.com/">Peshawar</option>
<option style=" background-color: black; " value="http://google.com/">F7, Islamabad</option>
<option style=" background-color: black; " value="http://yahoo.com/" >Bahria Islamabad</option>
<option style=" background-color: black; " value="http://bing.com/">Sialkot</option>
</select>
</div>
<input class="button-46" style="width: 50%; padding: 6px;" type="submit" name="SUBMITBUTTON" value="Submit" />
<!-- HTML !-->
</form>
<!--end form-->
</div>
<!--end col-md-6-->
</div>
<!--end row-->
<div>
</div>
<script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
<script>
$('#link').on('submit', function (e) {
e.preventDefault();
var $form = $(this),
$select = $form.find('select'),
links = $select.val();
window.open(links,"_self");
if (links.length > 0) {
for (i in links) {
link = links[i];ccc
window.open(links,"_self");
}
}
});
</script>