Aurai
[E-Mail]
1999/10/06(水) 03:49:36
function textchange(targettextarea,rcode,i,j) {
if (targettextarea.value.indexOf(unescape('%0D%0A')) > -1) rcode = unescape('%0D%0A')
else if (targettextarea.value.indexOf(unescape('%0A')) > -1) rcode = unescape('%0A')
else rcode = unescape('%0D');
j = 0 - rcode.length;
for (i=0;i<2;i++) {
j = targettextarea.value.indexOf(rcode, j + rcode.length);
if (j==-1) break;
}
if (j != -1) targettextarea.value = targettextarea.value.substring(0,j);
}
と記述して置いて
<textarea name="text1" rows=2 cols=40 onChange="textchange(this)"></textarea>
とか