I’ve got some javascript that limits the characters in a textarea. It works fine on the client side.
<script language=”javascript” type=”text/javascript”>
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
} else {
limitCount.value = limitNum – limitField.value.length;
}
}
</script>
However, when I go to save to the database and use the return/enter key in my text, it throws an error.
Microsoft OLE DB Provider for SQL Server error ‘80040e21’
Can anyone help me with the return key, html its 1 character and saving to the database its 2, so I’m exceeding the nvarchar(1000). Any help would be appreciated.