I'm trying to redirect the user to another page, but, it need to be after the form submit, but I don't know how should I do it. I'm using php to submit the form, everything works, less this part, if needed I can post the PHP forms here. I don't want to redirect in php because I would have to create a section/take its data to get the option that have been choose.
On this code, after the selection of an option, the user is automaticaly redirected to the page linked to the option, not submiting the form.
This is what I have.
<form>
<select data-select-name="" id="select-45ba" name="select" class="u-border-1 u-border-grey-30 u-input u-input-rectangle u-radius-50 u-white u-input-15">
<option value="QTD">QTD</option>
<option value="index.html">1 - R$32</option>
<option value="https://linkedin.com">2 - R$64</option>
<option value="https://twitter.com">3 - R$96</option>
<option value="https://instagram.com">4 - R$128</option>
<option value="https://youtube.com">5 - R$160</option>
</select>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
document.querySelector('select[data-select-name]').onchange = changeEventHandler;
}, false);
function changeEventHandler(event) {
window.location.submit = this.options[this.selectedIndex].value;
}
</script>
<button type="submit">Submit</button>
</form>