damerit Posted November 7, 2008 Share Posted November 7, 2008 I want to validate so that if the checkbox of 'bypass' is not checked or if a text field = "" then a message to choose one or the other. I wrote the one below but it deeps asking for input both. I even used the or || operator. Can someone help me make sense of this? .... thnks function validateForm(thisForm){ if ((thisForm.bypass.checked == true) && (thisForm.whatObject.value == "")){ alert("Enter an answer or check bypass."); return false; } Quote Link to comment Share on other sites More sharing options...
damerit Posted November 7, 2008 Author Share Posted November 7, 2008 I added a true statement and it worked. function validateForm(thisForm){ if ((thisForm.severity.value == "High") && (thisForm.bypass.checked == true) && (thisForm.whatObject.value == "")){ alert("Enter an answer or check bypass."); return false; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.