Hello,
I'm having problem with a page because it's doing submit even when validation returns false
.
$("#botao1").click(function() {
$.ajax({
url : 'adicionadaIdeia',
type : 'POST',
async : false,
data : $("#form1").serialize(),
success : document.getElementById("botao2").click(),
});
return false;
});
function validar() {
//Verifica se necessidade tem item selecionado
if($('input[name=Listanecessidade]:checked').length == 0){
alert("Selecione uma necessidade!");
$('input[name=Listanecessidade]').focus();
return false;
}
}
I wanted to know how I avoid having the page make submit in that situation (where the return is false
)
# botao1 has the following configuration:
<input type="submit" id="botao1" value="Cadastrar">