var text1 = document.getElementById('write_box_text').value; var text2 = document.getElementById('write_box_tema').value; if (!(text1 && text2)) ...