0
I need to keep the value one input radio
to concatenate into a href later, but before making the Submit.
My form code:
<form action="recuperarsenha.php" method="POST" onsubmit="displayWaitMessage()">
<div class="form-group">
<label for="labelemail">Email</label>
<input name="email" class="form-control" placeholder="example@example" autofocus required >
</div>
<div class="form-group">
<center>
<input name="tipo" value="candidato" type="radio" checked> Candidato
<input name="tipo" value="professor" type="radio"> Professor
<input name="tipo" value="secretario" type="radio"> Secretaria
</center>
</div>
<center>
<a class="btn btn-danger" href='../candidato/index.php'>Voltar</a>
<input class="btn btn-primary" type="submit" value="Enviar">
</center>
</form>
My Java:
<script type="text/javascript">
var x = document.getElementsByName("tipo");
if(x == 'candidato'){
var endereco = '../candidato/index.php';
}else if(x == 'secretario'){
var endereco = '../secretaria/index.php';
}else if(x == 'professor'){
var endereco = '../professor/index.php';
</script>
How do I get this var endereco
and put in the <a class="btn btn-danger" href='../candidato/index.php'>Voltar</a>
It worked, thank you very much :D
– Andre Lacomski