<!DOCTYPE html>
<html>
<head>
<title>CheckBox必勾檢核</title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.js"
type="text/javascript"> </script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.js"
type="text/javascript"> </script>
<script>
$(function () {
//REF: http://bit.ly/hySvLa
$.validator.unobtrusive.adapters.addBool("mandatory", "required");
});
</script>
<script src="http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.js"
type="text/javascript"> </script>
<link href="Content/validationEngine.jquery.css" rel="stylesheet" type="text/css" />
<script src="Scripts/jquery.validate.inline.js" type="text/javascript"> </script>
<script type="text/javascript">
$(function () {
//REF: http://blog2.darkthread.net/post-2011-07-04-asp-net-mvc-inline-validation-chinese.aspx
$("form").makeValidationInline();
});
</script>
</head>
<body style="padding: 50px; font-size: 9pt;">
<form id="form1" action="test.htm" method="get">
文字欄位: <input type="text" id="t1" name="t1" data-val="true" data-val-required="不可空白" />
<div style="margin-top: 10px;">
<textarea style="width: 260px; height: 50px;">
各人造業各人擔...各人造業各人擔...各人造業各人擔...各人造業各人擔...各人造業各人擔...各人造業各人擔...
</textarea>
<br />
<input type="checkbox" id="c1" name="c1" data-val="true" data-val-mandatory="請勾選已閱讀" />
<span>我已閱讀並接受"美股投公司服務條款及免責聲明"</span>
</div>
<input type="submit" value="送出" />
</form>
</body>
</html>