[whatwg] Re: credit card numbers

Håkon Wium Lie howcome at opera.com
Wed Aug 4 07:19:03 PDT 2004

Also sprach fantasai:

 > >  > > credit card numbers have their own type. Perhaps expire dates should
 > >  > > as well. This would help auto-fillout immensely and merchants would
 > >  > > rejoice.
 > >  > 
 > >  > <input type="month"> (previously known as type="expdate")?
 > >  > "This type is used most frequently for credit card expiry dates."
 > >  >  -- http://whatwg.org/specs/web-forms/current-work/#month 
 > >  > 
 > >  > Or am I missing something here? 
 > > 
 > > "Month" is quite generic, and can be used for many purposes. "expdate"
 > > is more specific. If your UA knows the expdate of your credit card it
 > > can automatically fill inn the "expdate" control. However, filling in
 > > the expdate into "month" controls would be problematic since it's used
 > > for other purposes as well.
 > The type attribute is for giving the *type* of data, not for indicating
 > what it's used for. 

This depends on your definition of "type" and "used for". I can make
the argument that "expdate" is a type ("01/07") which is independent
of what it is used for.

However, I'm happy to user other means than the type attribute if
they are readily available.

 > RFC3106 deals with auto-fillout.

 >    # Some names (all starting with the string "Ecom_") in this version of
 >    # HTML forms have predefined meanings, allowing UAs to fill in the form
 >    # fields automatically. These names, and their semantics, are described
 >    # in [RFC3106].
 > (We should probably get that expanded to handle WF2 controls, though.)

So, which of these would work in WF2?:

  <input type="text" pattern="[0-9]{10}" name="cc" />
  <input type="text" pattern="[0-9]{10}" name="Ecom_Payment_Card_Number" />
  <input type="number" name="Ecom_Payment_Card_Number" />
  <input name="Ecom_Payment_Card_Number" />

The fields in RFC3102 are more specific than the values on the type
attribute. Prediction: combining them will lead to unpredictable

Instead of doing ECML half-heartedly, why not extract the most useful
types/names (including credit card numbers and expire dates) and
describe them in WF2?

              Håkon Wium Lie                          CTO °þe®ª
howcome at opera.com                  http://people.opera.com/howcome

More information about the whatwg mailing list