<html>
<head>
</head>
<body>
<form action="http://javascript.ru" id="form">
<input type="checkbox" id="cbx">
<div id="div">
<textarea id="txt1" disabled></textarea><textarea id="txt2" disabled></textarea>
</div>
<input type="button" value="Отправить" onClick="func()">
</form>
<script>
function func() {
if (document.getElementById("cbx").checked) {
if (document.getElementById("txt1").value == "" || document.getElementById("txt2").value == "") {
return alert("незаполнено");
}
document.getElementById("form").submit();
}
else {
document.getElementById("form").submit();
}
}
document.getElementById("cbx").addEventListener("change", function(e) {
document.getElementById('txt1').value ='';
document.getElementById('txt2').value ='';
document.getElementById('txt1').disabled=!this.checked;
document.getElementById('txt2').disabled=!this.checked;
});
</script>
</body>
</html>