marko_one
10-20-2003, 09:06 AM
Hi All,
I have a contenteditable div which I am using for a rich text box, I pre-fill it with
document.all.myTextDiv.innerHTML = "<%=myText.value%>"
what I need to do is check limit the maximum amout of characters typed into the editable region. I was thinking of using something like :
function setMax(myDivText, maxlength)
{
if (myDivText.value.length > maxlength)
{
myDivText.value = myDivText.value.substring(0,maxlength);
}
}
to set this maximum length, but it doesnt seem to work, can anybody put me straigh on this one?
thanks
marko.
I have a contenteditable div which I am using for a rich text box, I pre-fill it with
document.all.myTextDiv.innerHTML = "<%=myText.value%>"
what I need to do is check limit the maximum amout of characters typed into the editable region. I was thinking of using something like :
function setMax(myDivText, maxlength)
{
if (myDivText.value.length > maxlength)
{
myDivText.value = myDivText.value.substring(0,maxlength);
}
}
to set this maximum length, but it doesnt seem to work, can anybody put me straigh on this one?
thanks
marko.