[whatwg] Web forms 2, input type suggestions

Martin Atkins mart at degeneration.co.uk
Sat Jul 14 07:14:47 PDT 2007


Benjamin Joffe wrote:
> Have the following possible values for the TYPE attribute been 
> considered for the INPUT element?
> 
> type="color"
> The user agent would display an appropriate colour picker and would send 
> a hexidecimal string represting that colour to the server.

I like this idea. It's simple and it's something I've implemented (and 
seen implemented) dozens of times.

> type="address"
> Indicates that the input should represent an address, the user agent may 
> aid by displaying data from a GPS or use an online map etc.

I have a little more trouble with this idea, for a number of reasons:
  * Address formats vary from region to region.
  * Sites usually want items like the postal code, state, county or town 
separated from the street address for various reasons. This is not 
catered for by your proposal.
  * To do anything special for this field beyond just displaying a big 
text box some sort of external data source is required, but it is not at 
all obvious what that data source would be or what a good UI for this 
field type might be.

> type="location"
> Same as above but instead of sending an address string it would send 
> latitude/longitude information, this (as opposed to the above) would 
> send a well-formed string.
> 
> Perhaps coordinates/geocoordinates or something else would be a more 
> suitable name for the latter. 
> 

I have similar reservations about this one, but at least there is a more 
obvious UI: mobile devices with built in GPS recievers could concievably 
provide an option to fill in the current coordinates.

However, I'm not sure that submitting geographic coordinates is a common 
enough case to warrant an input type of its own. Part of me wants to 
generalize it to be type="2dvector" and type="3dvector", which can then 
represent any 2D or 3D coordinates. I'm not really sure what a UA would 
do to such a field that would be any more useful than two or three 
type="text" elements, though.




More information about the whatwg mailing list