2012-12-14 49 views
0

我有這樣的形式:HTML消失後提交

<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(); 
} 
+1

consultarEventosParticipante()可能是這樣做的。你沒有包含這個代碼,所以我只能猜測。 –

+0

它不是清理整個頁面嗎?因爲表單已提交? –

+0

我爲你格式化你的代碼。請不要提交醜陋的無格式代碼 –

回答

0

顯然,問題得到解決。我把表單標籤放在字段集中,問題就沒有了。我不明白它的原因,但那是解決這個錯誤的方法。