0
的對象錯誤,我爲MVC 2.0在一個特定的文本已經爲文本框中maximun字符內......但似乎得到了一個未定義的錯誤,這是我的看法未定義null或在JavaScript
<td>
<%= Html.TextArea("Description", Model.Description, new{id = "descriptionId",onKeyDown = "limitText(this.form.Description,this.form.countdown,1000);",onKeyUp = "limitText(this.form.Description,this.form.countdown,1000);"})%>
</td>
這是我的腳本....
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
} else {
limitCount.value = limitNum - limitField.value.length;
alert(limitCount.value);
}
}