Auto Submit Demo

Submitted OTP is:
<h:form id="example">
            <h:panelGrid columns="3">
                <p:outputLabel for="otp" value="OTP:"/>
                <p:inputText id="otp" size="6" value="#{inputOutputController.value}">
                    <ejsf:otpValidator/>
                    <ejsf:autoSubmit target="submit" whenLength="6"/>
                </p:inputText>
                <p:message for="otp"/>
            </h:panelGrid>
            <h:panelGrid columns="1">
                Submitted OTP is: #{inputOutputController.value}
            </h:panelGrid>
            <h:panelGrid columns="1">
                <p:commandButton id="submit" update="@form" value="Submit"/>
            </h:panelGrid>
        </h:form>