Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a naming convention for HTML form fields for good auto completion across all modern browsers?

Is there a naming convention for form fields? For what fields do Chrome, IE, Firefox look for? I mean, one for all, or at least most of the modern browsers.

I stumbled upon:

  • http://wonderfullyflawed.com/2009/02/17/rails-forms-microformat
  • http://acidmartin.wordpress.com/2008/10/28/using-ecml-11-to-make-website-forms-compatible-with-google-toobar-autofill-and-wand/ -> talking about http://www.ietf.org/rfc/rfc3106.txt
  • Names of HTML form naming conventions
  • Form field names used by personal data auto-fill in browsers (Safari, Opera)

e.g. the ECML approach uses such names:

Description               Field name
----------------------------------------------------------
ship to title             Ecom_ShipTo_Postal_Name_Prefix
ship to first name        Ecom_ShipTo_Postal_Name_First
ship to middle name       Ecom_ShipTo_Postal_Name_Middle
ship to last name         Ecom_ShipTo_Postal_Name_Last

user ID                   Ecom_User_ID
user password             Ecom_User_Password

But those "Ecom_..." form fields appear odd to me?

I know about the IE-only and proprietary (of course) attribute VCARD_NAME="vCard.xyz", but it's an invalid html attribute.

Or is the best shot, to write the fields in the most common way like @F. B. suggests at Form field names used by personal data auto-fill in browsers (Safari, Opera)


Small Update (2015-07-21) - just stumbled upon this Google Developer Blog post which mentions the WHATWG HTML specs for Autofill:

https://html.spec.whatwg.org/multipage/forms.html#autofill

like image 720
roberkules Avatar asked Jun 15 '11 22:06

roberkules


People also ask

What is autocomplete in HTML form?

The HTML autocomplete attribute lets web developers specify what if any permission the user agent has to provide automated assistance in filling out form field values, as well as guidance to the browser as to the type of information expected in the field.

How do you autofill fields on a website?

Google ChromeGo to Settings → Autofill → Addresses and more. 2. Turn on the Save and fill addresses option. 3.

What are forms explain different form fields?

The form body contains Field elements that define how each element of the Web page appears and behaves. Each Field can contain other fields, each with its own display component.


1 Answers

You seem to have linked to the answers. If you are not using high-level frameworks like CakePHP or Ruby on Rails, though, the first and third links do not apply.

The thing is, it's Google Toolbar and Wand's job to fill out forms successfully. Given the scope of the internet, the toolbar must have tons of redundancy.

Therefore, as long as you keep your form fields semanticly named, the form should autofill.

ECML is E-Commerce Modeling Language. Ecom_ simply stands for E-Commerce. If you need to sell stuff, use that naming convention.

like image 62
citelao Avatar answered Oct 11 '22 18:10

citelao