4 Replies Latest reply on Nov 4, 2008 8:35 AM by khaled_288

    how to implement AJAXed check username availability

    khaled_288


      I'm trying to implement "check username availability" using AJAX.

      <f:view locale="#{language.locale}">
      
      <h:form id="mainForm">
      
      <h:outputText value="#{msg.webUserID}"/>
      
      <h:inputText value="#{createNewUser.user.webUserID}" id="webUserID" maxlength="20" required="true" rendered="#{not createNewUser.created}" >
       <f:validator validatorId="usernameValidator" />
       <rich:ajaxValidator event="onblur"/>
      </h:inputText>
      <rich:message for="username"/>
      
      
      <h:commandButton id="submit" value="Create" action="#{addUser.add}" />
      
      </h:form>
      </f:view>


      Now it works fine "onblur" but i dont want the validation work in this event. I want to add link for this functionality.

      I want to run the validation on link clicked. So i will add a link beside the field "username". let say "Check Availability" link and when user clicks on this link, the validation shall work AJAXly.



      ANY IDEA ??