Affects Version/s: None
Fix Version/s: None
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="#
<%-- Credit Card Number --%>
<h:outputLabel for="cardNumber" value="Credit Card Number"/>
<h:inputText id="cardNumber" value="#
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.