Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

261
Visualizações
How to clear all input fields after getting form validation in jsf

Here i have jsf code for input fileds that have an form validator.

<h:form id="myForm">
     <script>
      function resetform() {
            document.getElementById("anomalies-list-form").reset();
      }
    
     </script>
      <h:panelGrid>
            <h:outputText value="Source IP"/>
             <h:panelGroup>
                    <h:inputText id="SourceIP" size="13" value="#{dataListBean.sourceIp}" title="Enter first few letters for searching similar records"  >
                            <f:validator validatorId="SQLInjectionValidator"/>
                    </h:inputText>
                            <h:message style="color:red" for="SourceIP"/>
            </h:panelGroup>
    
             <h:outputText value="IP"/>
             <h:panelGroup>
                    <h:inputText id="IP" size="13" value="#{dataListBean.destIp}">
                            <f:validator validatorId="SQLInjectionValidator"/>
                    </h:inputText>
                            <h:message style="color:red" for="IP"/>
            </h:panelGroup>
             <h:outputText value=""/>
             <h:panelGroup>
                  <h:commandButton id="show" value="Show" action="#{dataListBean.showSelectedType}"/>
                  <h:commandButton id="clear" value="Clear" onclick="resetform()">
                  </h:commandButton>
             </h:panelGroup>
       </h:panelGrid>
    </h:form>

if i get a validation on any filed i want clear all filed with clear button but it is not working.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda