0
Currently my code is opening in a new window the payment page, I would like it to be redirected to another page when click send form depending on the value
who is in the option
of the second dropbox
.
I tried to use the code window.location.href
and it didn’t work.
$(function() {
$('#btnget').click(function() {
let formValido = document
.getElementById("formulario")
.checkValidity();
if (formValido)
window.open($('#chkveg').val());
})
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<form id="formulario" action="<? $PHP_SELF; ?>" method="POST">
<select id="eassociado" name="eassociado">
<option disabled selected value> -- Selecione uma opção -- </option>
<option>ABRAPP</option>
<option>ABAAI</option>
<option>IBGC</option>
<option>ABRACAM</option>
<option>ABBC</option>
<option>Associados Ancord</option>
<option>Não Associados</option>
</select>
<select name="ingresso" id="chkveg">
<option value="https://pag.ae/7ULKPL7TH">Associados Ancord + C.Dados = R$700,00</option>
<option value="https://pag.ae/7ULKQ8Zm2">Associados Ancord Normal = R$800,00</option>
<option value="https://pag.ae/7UTdp8_CG">Associados Entidades Apoiadoras + C.Dados = R$875,00</option>
<option value="https://pag.ae/7UTdpwWem">Associados Entidades Apoiadoras Normal = R$1.000,00</option>
<option value="https://pag.ae/7UTdpPZjn">Não Associados + C.Dados = R$1.100,00</option>
<option value="https://pag.ae/7UTdq2JsG">Não Associados Normal = R$1.250,00</option>
</select>
<input name="envia" id="btnget" class="submit-btn" type="submit" value="INSCREVER-SE">
</form>
tried window.location.href = "http://..." that way?
– Larissa silva
yes, it won’t, it just gives like a refresh on the page
– Chead
where is the button that submits the form?
– Sam
I forgot to put, put here
– Chead