我有这个表格:
<div id="tudo">
<div id="sige">
<div id="voltar_sair">
<a href="ServletListarEventosInscricoesAbertas.do" id="voltar">Voltar</a>
</div>
<h1>SIGE - Sistema de Gerenciamento de Eventos </h1>
<form name="form" method="post" action="" id="sige">
<input type="hidden" name="codigoEvento" value="<%=codigoEvento%>">
<input type="hidden" name="tela" value="<%=tela%>"> <input
type="hidden" id="hidden" value="<%=cpf%>">
<fieldset>
<legend>Consultar Eventos do Participante</legend>
<p>
<label for="cpf">CPF:</label> <input id="cpf" name="cpf" class="mascara-cpf" type="text" onblur="if(this.value != ''){ValidarCPF(this);}" value="<%=cpf%>"/>
</p>
</fieldset>
<p>
<input class="botoes_form" value="Consultar" id="reemitir" type="button" onClick="javascript:consultarEventosParticipante()"/>
<input class="botoes_form" value="Limpar" id="limpar" type="reset" onclick="$('#cpf').val()"/>
</p>
并且,在提交表单后,带有标签和输入(文本)的整个 p 消失了。
我能做些什么来解决这个问题?
编辑:
function consultarEventosParticipante(){
if(document.form.cpf.value == ""){
alert("Por favor, digite o campo C.P.F.");
return;
}
document.form.action="ServletInicioConsultarEventosParticipante";
document.form.submit();
}