MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-88

Add ability for credit card validator to choose card type based on another component


    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Validators
    • Labels:


      It would be nice if the credit card validator could, in one of its attributes, optionally specify the ID of another component, whose value should be used to determine which card type should be used in the validation. This would come in handy for forms that have a select-one component with a list of credit card types. I would think that forms with both card type and card number are common.

      Example of tags:

      <%-- Credit Card Type --%>
      <h:outputLabel for="cardType" value="Credit Card Type"/>
      <h:selectOneMenu id="cardType" value="#


      " required="true">
      <f:selectItems value="#



      <%-- Credit Card Number --%>
      <h:outputLabel for="cardNumber" value="Credit Card Number"/>
      <h:inputText id="cardNumber" value="#


      " required="true">
      <t:validateCreditCard forCardType="cardType"/>

      The code would have to make an assumption about what values from the card type map to which credit cards. The values amex, visa, mastercard, and discover seem appropriate.

      I may get around to adding this ability, in which case I will attach the patches here. If I don't, though, I wanted to capture this suggestion in case someone else wants to do it.


        There are no comments yet on this issue.


          • Assignee:
            Matthias Weßendorf
            Ken Weiner
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: