Skip to content

[html] 第13天 html5中的form怎么关闭自动完成? #38

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

第13天 html5中的form怎么关闭自动完成?

Activity

yxkhaha

yxkhaha commented on Apr 29, 2019

@yxkhaha

设置form的autocomplete属性为off

chenliwen123

chenliwen123 commented on Jul 10, 2019

@chenliwen123

autocomplete="off"

seho-dev

seho-dev commented on Jul 26, 2019

@seho-dev

h5新增的补全功能,菜鸟教程上写的比较含糊比较难懂;
解释: 在部分浏览器上,foucs输入框可以把之前输入过的值自动填入,如果不想自动填入,可以关掉它;
autocomplete="off"
默认是"on" 开启状态

一般业务下不会调整这个自动完成,因为对产品来说简化用户操作,建议打开

Konata9

Konata9 commented on Jul 27, 2019

@Konata9

input 标签中,可以设置 autocomplete="off" 来关闭自动完成。
但这个属性在不同的浏览器上兼容并不好,因此需要配合 type="newpassword" 等其他属性来关闭自动完成。

hc951221

hc951221 commented on Aug 7, 2019

@hc951221

看到这个问题我懵逼了,不知道啥是自动完成

haizhilin2013

haizhilin2013 commented on Aug 7, 2019

@haizhilin2013
CollaboratorAuthor

@hc951221 正好学习下,查漏补缺

LeiDeMing

LeiDeMing commented on Sep 19, 2019

@LeiDeMing

TIM截图20190919152612.png
我来科普啦!

<form action="" id="formDom">
        <label for="in1">请输入</label><input id="in1" type="text" >
        <input type="submit" value="提交"  autocomplete='off'>
</form>

let formDom=document.querySelector('#formDom')
    formDom.onclick=function(e){
         e.preventDefault(); //阻止默认事件,防止自动提交
 }
wython

wython commented on Dec 10, 2019

@wython

自动补全,自动完成第一反应不知道问的啥

zlqGitHub

zlqGitHub commented on Dec 29, 2019

@zlqGitHub

操作表单form的autocomplete属性值

<form action="demo_form.html" method="get" autocomplete="off">
  First name:<input type="text" name="fname"><br>
  E-mail: <input type="email" name="email"><br>
  <input type="submit">
</form>
lishichengyan

lishichengyan commented on Feb 24, 2020

@lishichengyan

也许把问题改成“自动填充”或者“自动补全”会好一点。

blueRoach

blueRoach commented on May 29, 2020

@blueRoach

autocomplete=“off“
默认是开启的,作用是你之前输入过并且提交过的表单,再次输入时会有会有自动补全的下拉

giggleCYT

giggleCYT commented on Jun 8, 2020

@giggleCYT

autocomplate="off"

Nehic

Nehic commented on Jan 5, 2021

@Nehic

密码加onfocus="this.type='password"
<input type="text" onfocus="this.type='password">

8 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @haizhilin2013@Konata9@LeiDeMing@buuug7@wython

        Issue actions

          [html] 第13天 html5中的form怎么关闭自动完成? · Issue #38 · haizlin/fe-interview