0
我有使用javascript驗證我的表單。我想設置ErrorControl css代碼。但我無法獲得輸出。通過javascript在asp.net textbox控件中設置css類
<style type="text/css">
.ErrorControl
{
background-color: #FBE3E4;
border: solid 1px Red;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
//HighlightControlToValidate();
$("#Button1").click(function() {
if (typeof (Page_Validators) != "undefined") {
for (var i = 0; i < Page_Validators.length; i++) {
if (!Page_Validators[i].isvalid) {
$('#' + Page_Validators[i].controltovalidate).className = "ErrorControl";
}
else {
$('#' + Page_Validators[i].controltovalidate).css("border", "solid 1px White");
}
}
}
});
});
</script>
什麼是在控制檯中顯示? – tnanoba