我正在使用asp.net Web Forms中的文本框验证器。例如,如果textbox 5的值大于textbox 6的值,则显示错误。我尝试使用此处的验证器引擎:
http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/
问题是,当我尝试在文件脚本中引用引擎时,它不会加载。
这是脚本:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js" type="text/javascript"></script>
<script src="~/Scripts/jquery.validationEngine.js"></script>
<script src="~/Scripts/jquery.validationEngine-cz.js"></script>
<script>
jQuery(document).ready(function () {
jQuery("#ctl01").validationEngine();
});
/**
*
* @param {jqObject} the field where the validation applies
* @param {Array[String]} validation rules for this field
* @param {int} rule index
* @param {Map} form options
* @return an error string if validation failed
*/
</script>
并在此处出错:
有什么想法吗?
答案 0 :(得分:2)
试试这个
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js" type="text/javascript"></script>
<script src="/Scripts/jquery.validationEngine.js"></script>
<script src="/Scripts/jquery.validationEngine-cz.js"></script>
<script>
jQuery(document).ready(function () {
jQuery("#ctl01").validationEngine();
});
/**
*
* @param {jqObject} the field where the validation applies
* @param {Array[String]} validation rules for this field
* @param {int} rule index
* @param {Map} form options
* @return an error string if validation failed
*/
</script>
~
用于相关路径,因此它在错误的位置查找脚本。