Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 否';保存密码';任何浏览器提示我的表单_Html_Forms_Zend Framework - Fatal编程技术网

Html 否';保存密码';任何浏览器提示我的表单

Html 否';保存密码';任何浏览器提示我的表单,html,forms,zend-framework,Html,Forms,Zend Framework,我的表格附在下面,我尝试了很多在其他论坛上找到的东西,但都没有用。我无法让浏览器提示“保存密码”。我哪里做错了。希望有人能帮忙。谢谢 <form id="frmlogin" action="/index" method="post" enctype="application/x-www-form-urlencoded" autocomplete="on"> <label id="landing_username" class="required" for="us

我的表格附在下面,我尝试了很多在其他论坛上找到的东西,但都没有用。我无法让浏览器提示“保存密码”。我哪里做错了。希望有人能帮忙。谢谢

<form id="frmlogin" action="/index" method="post" enctype="application/x-www-form-urlencoded" autocomplete="on">
        <label id="landing_username" class="required" for="username">Username/Email</label>
        <input id="landing_username" name="username" type="text" value="" name="username" />
        <label id="landing_password"  class="required" for="password">Password</label>
        <input id="landing_password"  name="password" type="password" value="" name="password" />
        <submit id="loginbtn" onclick="LoginFun()" type="submit" name="loginbtn">Login</submit>
</form>

用户名/电子邮件
暗语
登录

试着清理一下HTML,可能会有帮助:

<form id="frmlogin" action="/index" method="post">
    <label id="landing_username" class="required" for="username">Username/Email</label>
    <input id="username" name="username" type="text"  />
    <label id="landing_password"  class="required" for="password">Password</label>
    <input id="password" name="password" type="password" />
    <input id="loginbtn" onclick="LoginFun()" type="submit" name="loginbtn" value="Login" />
 </form>

用户名/电子邮件
暗语
  • 表单属性
    enctype
    默认为
    application/x-www-form-urlencoded
    ,因此无需指定它
  • 属性的标签
    应包含相关输入的
    id
    ,而不是
    名称
  • 元素ID应该是唯一的
  • 属性
    name
    为密码和用户名定义了两次
  • 默认情况下,
    autocomplete
    属性为on
  • 输入值
    不是必需的,因此您不需要使用空字符串将其添加到输入中
  • 提交按钮应为提交类型的输入

这些更改中的一些只是优化,没有优化代码也可以正常工作,但其他更改(如确保每个标记的唯一id)是修复,即使浏览器正确显示表单,也强烈建议进行修复。

尝试清理一下HTML,可能会有帮助:

<form id="frmlogin" action="/index" method="post">
    <label id="landing_username" class="required" for="username">Username/Email</label>
    <input id="username" name="username" type="text"  />
    <label id="landing_password"  class="required" for="password">Password</label>
    <input id="password" name="password" type="password" />
    <input id="loginbtn" onclick="LoginFun()" type="submit" name="loginbtn" value="Login" />
 </form>

用户名/电子邮件
暗语
  • 表单属性
    enctype
    默认为
    application/x-www-form-urlencoded
    ,因此无需指定它
  • 属性的标签
    应包含相关输入的
    id
    ,而不是
    名称
  • 元素ID应该是唯一的
  • 属性
    name
    为密码和用户名定义了两次
  • 默认情况下,
    autocomplete
    属性为on
  • 输入值
    不是必需的,因此您不需要使用空字符串将其添加到输入中
  • 提交按钮应为提交类型的输入
其中一些更改只是优化,没有优化代码也可以正常工作,但其他更改(如确保每个标记的唯一id)是修复,即使浏览器正确显示表单,也强烈建议使用这些更改