`

火狐浏览器下当前用户和密码缓存问题

    博客分类:
  • Html
阅读更多

今天发现一个问题,记录一下

 

环境:火狐浏览器

开发新建用户功能时,碰到一个狗血的问题

 

当表单含有一个type="text"的input控件和一个type="password"的input控件时,奇妙的事情发生了:

默认会把当前用户的登录名填充到type="text"的input控件中,把登录密码填充到type="password"中

 

如图:

 

 

<table id="infoTab" cellpadding="0" cellspacing="0" class="def-table">
	<tr>
		<td >用户名<span style="color:red">*</span>:</td>
		<td colSpan="3" id="tdLoginName">
			<input id="txtLoginName" name="loginName" type="text" ltype="text"  validate="{required:true, minlength:5,maxlength:10,stringCheck:true,checkLoginName:true}"/>
		</td>
		<td colSpan="3"id="tdTxtName"><span id="loginName">${userPojo.loginname}</span></td>			
</tr>
	<tr>
		<td >姓名<span style="color:red">*</span>:</td>
		<td colSpan="3">
			<input id="txtUsername" name="username" value="${userPojo.username}" type="text"  ltype="text"  validate="{required:true, maxlength:20}"/>
		</td>
	</tr>
	<tr>
		<td >电话:</td>
		<td colSpan="3">
			<input id="txtMobile" name="mobilephone" value="${userPojo.mobilephone}" type="text" ltype="text"  validate="{isMobile:true}" />
		</td>
	</tr>
	<tr>
		<td>邮箱<span style="color:red">*</span>:</td>
		<td colSpan="3">
			<input id="txtEmail" name="useremail" value="${userPojo.email}" type="text" ltype="text"  validate="{required:true, maxlength:60,email:true}"/>
		</td>
	</tr>
	<tr id="trPassword">
		<td >密码<span style="color:red">*</span>:</td>
		<td colSpan="3">
			<input id="txtPassword" name="userpwd" type="password" autocomplete="off" ltype="password" value="${userPojo.password}" validate="{required: true, minlength:6,maxlength:16}"/>
		</td>
	</tr>
	<tr id="trComfirmpwd">
		<td >确认密码<span style="color:red">*</span>:</td>
		<td colSpan="3">
			<input id="comfirmpwd" name="comfirmpwd" type="password" autocomplete="off" ltype="password"  validate="{required:true, minlength:6,maxlength:16,equalTo:'#txtPassword'}"/>
		</td>
	</tr>
</table>

 

解决方案:

在type="password"的input控件中添加属性autocomplete="off"

 

 

分享到:
评论
1 楼 chenlei239 2013-01-06  
    

相关推荐

Global site tag (gtag.js) - Google Analytics