【发布时间】:2019-07-25 00:06:43
【问题描述】:
我在控制台中收到此消息,我无法理解。请仔细查看
<!DOCTYPE html>
<html>
<head>
<title>registration page</title>
<script src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('form').submit(function(event){
"use strict";
var valid = true,
message = '';
$('.error').remove();
$('form input').each(function() {
var $this = $(this);
if(!$this.val()) {
message='';
var inputName = $this.attr('name');
valid = false;
message += 'Please enter your ' + inputName + '\n';
$(this).closest('div').append('<div class="error">'+message+'</div>');
}
})
if(!valid){
event.preventDefault();
}else{
$('form').serialize()
}
})
})
</script>
</head>
<body>
<form>
<div>
<label>Name</label>
<input type="text" name="name"><br>
</div>
<div>
<label>File</label>
<input type="file" name="file"><br>
</div>
<div>
<label>password</label>
<input type="password" name="password"><br>
</div>
<button type='submit'>Submit</button>
</form>
</body>
</html>
问题是尽管没有错误,但我一直收到此消息
[DOM] Input elements should have autocomplete attributes (suggested: "current-password"):
我在控制台中获得了一个谷歌链接,该链接将我带到(More info: goo.gl/9p2vKq)
【问题讨论】:
-
最好将自动完成设置为“关闭”,以后会有所帮助
标签: javascript php jquery google-chrome