找到解决方案。谢谢!
<div class="form-row"><h2>
<input style="margin-right: 5px;" type="text6" name="outstanding1" id="outstanding" onClick="document.getElementById('form2').style.display='none';"/>Please initial if you do not have any outstanding items.
<script>
var outstanding = document.getElementById("outstanding");
outstanding.onchange = function() {
if(outstanding.value =='') document.getElementById("form2").style.display = "block";
};
</script>