questa può andare bene?
codice:
<html>
<head>
<script>
function check(txt) {
if (txt.value.length > 0) {
if (txt.getAttribute('id') == "t1") {
document.getElementById('t2').disabled = "disabled";
}
if (txt.getAttribute('id') == "t2") {
document.getElementById('t1').disabled = "disabled";
}
}
else {
if (txt.getAttribute('id') == "t1") {
document.getElementById('t2').removeAttribute('disabled');
}
if (txt.getAttribute('id') == "t2") {
document.getElementById('t1').removeAttribute('disabled');
}
}
}
</script>
</head>
<body>
<textarea id="t1" onkeyup="check(this)"></textarea>
<textarea id="t2" onkeyup="check(this)"></textarea>
</body>
</html>
Ciao