<script>
function IsEmpty(oText)
{
  if(oText.id=="text1")
  {
      var oText = document.getElementById("text2");
      if(oText.value)
      {
        alert("Another input is not empty")
      }
  }
  if(oText.id=="text2")
  {
      var oText = document.getElementById("text1");
      if(oText.value)
      {
        alert("Another input is not empty")
      }
  }
}
</script><input type="text" id="text1" onchange="IsEmpty(this)" />
<input type="text" id="text2" onchange="IsEmpty(this)" />