title: Jquery form: sendbutton may only appear when 2 conditions are fulfilled
body: <p>I'm making a form with 2 fields: one for users to fill in their emailadress and the other is a messagefield.
  My goal in this story here: I want to have a sendbutton to appear only when in the emailfield a @ and a . appears AND when there's something written in the messagefield.
  The result with code here: 
  the sendbutton appears when there's a @ and a . written in the emailfield, so that's ok... but it also appears when the messagefield is empty.<br>
  The code works when I only have one variable in the if-statement:</p>
  
  <pre><code>if(at != -1 &amp;&amp; punt != -1) --&gt; works;
  
  if(message !="") --&gt; works; 
  </code></pre>
  
  <p>But when I combine the 2 in 1 If-statement, as written here below it doesn't work the way I want it to.
  I assume I have to write my if-statement differently but I don't know how... somebody has a clue?</p>
  
  <pre><code>$(document).ready(function(){
  
      $("#email, .contactmessage").keyup(function(){
  
          var email = document.getElementById("email").value;
          var message = document.getElementsByClassName("contactmessage").value;
          //var email = $("#email").val();
  
          var at = email.indexOf("@");
          var punt = email.indexOf(".");
  
  
  
          if(at != -1 &amp;&amp; punt != -1 &amp;&amp; message !="")      {
              $(".deel2").slideDown();
          }
          else
          {
              $(".deel2").slideUp();
          }
      });
  
      });
  </code></pre>