Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

262
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda