Asp.net mvc 所需属性的dataannotations在IE8中不起作用
我有一个MVC-4项目,jQueryVersion1.9.1和jQueryUI-1.10.2。 我使用了下面的代码Asp.net mvc 所需属性的dataannotations在IE8中不起作用,asp.net-mvc,Asp.net Mvc,我有一个MVC-4项目,jQueryVersion1.9.1和jQueryUI-1.10.2。 我使用了下面的代码 [Required(ErrorMessage = "Required")] public string Name { get; set; } 它在所有其他浏览器中正常工作,然后是IE-8。 你能建议我需要做什么才能让它在IE-8中工作吗 感谢您的帮助。这是关于jquery.validate.js版本的 检查以下建议: 问题出在jquery.validate.js上。获取最新版本
[Required(ErrorMessage = "Required")]
public string Name { get; set; }
它在所有其他浏览器中正常工作,然后是IE-8。
你能建议我需要做什么才能让它在IE-8中工作吗
感谢您的帮助。这是关于
jquery.validate.js
版本的
检查以下建议:
问题出在jquery.validate.js上。获取最新版本或更改
return $([]).add(this.currentForm.elements)
.filter(":input")
与
工作守则:
//return $([]).add(this.currentForm.elements)
//.filter(":input")
return $(':input', this.currentForm)
.not(":submit, :reset, :image, [disabled]")
.not( this.settings.ignore )
.filter(function() {
!this.name && validator.settings.debug && window.console && console.error( "%o has no name assigned", this);
// select only the first element for each name, and only those with rules specified
if ( this.name in rulesCache || !validator.objectLength($(this).rules()) )
return false;
rulesCache[this.name] = true;
return true;
});
参考文献:
//return $([]).add(this.currentForm.elements)
//.filter(":input")
return $(':input', this.currentForm)
.not(":submit, :reset, :image, [disabled]")
.not( this.settings.ignore )
.filter(function() {
!this.name && validator.settings.debug && window.console && console.error( "%o has no name assigned", this);
// select only the first element for each name, and only those with rules specified
if ( this.name in rulesCache || !validator.objectLength($(this).rules()) )
return false;
rulesCache[this.name] = true;
return true;
});