使用自动填充表单控件(自动完成属性),加快表单填充速度
Making form filling faster, using autofilling form controls(the autocomplete attribute)
我正在开发一个html表单,用户可以在其中存储他们的账单和发货表单。在阅读了本文链接后,我试图使用这些属性,但它在chrome v-47中不起作用。我只使用提供的属性,例如运输表格:
<input autocomplete="given-name" autofocus id="ship_first_name" type="text" name="ship_first_name" value="" data-attr-ascii = "true" required/>
<input autocomplete="shipping tel" id="ship_telephone_no" type="text" name="ship_telephone_no" value="" data-attr-ascii = "true" required/>
<input autocomplete="shiiping address-line2" id="ship_address_line2" type="text" name="ship_address_line2" value="'" data-attr-ascii="true"/>
<input autocomplete="family-name" id="ship_last_name" type="text" name="ship_last_name" value="" data-attr-ascii = "true" required/>
<input autocomplete="shiiping address-line1" id="ship_address_line1" type="text" name="ship_address_line1" value=" data-attr-ascii="true" required/>
<input autocomplete="shipping postal-code" id="ship_zip_code" type="text" name="ship_zip_code" value="data-attr-ascii = "true" required/>
同样,我也在使用计费,但当我检查这些属性时,它不起作用。它不会提供从浏览器自动填充选项中选择值的选项。我的自动填充选项已启用。即使输入了相同的名称,它也不会填充其余的html字段。请给我一个建议,我哪里做错了。提前谢谢。
表单中有几个拼写错误。
在address-line1
和address-line2
之前,您将shipping
拼写为shiiping
。
在ship_address_line1
和ship_zip_code
中,value=
之后只有一个双引号,因此表单的其余部分被错误地解析。
Chrome显然需要输入在<form>
中才能执行自动填充。
<form>
<input autocomplete="given-name" autofocus id="ship_first_name" type="text" name="ship_first_name" value="" data-attr-ascii="true" required/>
<input autocomplete="shipping tel" id="ship_telephone_no" type="text" name="ship_telephone_no" value="" data-attr-ascii="true" required/>
<input autocomplete="shipping address-line2" id="ship_address_line2" type="text" name="ship_address_line2" value="'" data-attr-ascii="true" />
<input autocomplete="family-name" id="ship_last_name" type="text" name="ship_last_name" value="" data-attr-ascii="true" required/>
<input autocomplete="shipping address-line1" id="ship_address_line1" type="text" name="ship_address_line1" value="" data-attr-ascii="true" required/>
<input autocomplete="shipping postal-code" id="ship_zip_code" type="text" name="ship_zip_code" value="" data-attr-ascii="true" required/>
</form>
相关文章:
- 单击鼠标,用MySQL数据填充html表单输入字段
- 通过浏览器对表单自动填充做出反应
- 谷歌表单-根据分配给谷歌应用程序的工作为商业用户预先填充多项选择列表
- 提交表单时,Javascript(JQuery)不会在文本区域中填充内容
- Javascript未在开发服务器上填充Perl表单
- 如何在js中实现树结构类型的表单动态填充
- CasperJS填充表单-输入名称有方括号
- 如何使用多维JSON数据重新填充表单
- 试图用cookie中的信息填充表单
- 如何在刷新时重新填充表单中的复选框并将表单值发布到页面
- 单击一个数据表,填充第二个数据表
- 将表单填充到要与ngMessages一起使用的templateURL中
- jQuery表单填充器不工作
- Rails 输入表单填充了 jQuery .val(),但参数中不存在数据
- 使用自动填充表单控件(自动完成属性),加快表单填充速度
- HTML5地理位置地址表单填充器未捕获语法错误:意外的标记<
- 使用AJAX调用进行表单填充和验证
- 在检索数据时,表单填充然后清除
- 基于浏览器的客户端表单填充
- 从Google表单填充HTML表单