OK, heres the deal. Got a multiline <asp:textbox> where the user can enter a description. Problem that I found is that one cannot put a maxlength on a multiline <asp:textbox>.
So Wot i've done(bit of a hack) is bind a custom JS CheckFieldLength() event to the onPaste, onKeypress and onChange events of the control which simply looks like this:
//Constants to force maxlength on a multi-line textbox
//had to resort to this coz on cant put a maxlength on a
//Multiline asp:textbox!
//-------------------------------
var giCommentLength = 500;
//-------------------------------
function CheckFieldLength(vValue) {
if(vValue.length > giCommentLength) {
return false;
}
}
This just refuses to work. Any ideas?
Thanks!