title: onclick event on submit button
body: <p>I'm trying to make a verification that an input text has an email format after clicking submit buttom and calling a js function. The first problem i encounter is that after some tests, i've seen that it doesnt enter the called function. After this, i think everything should be ok, but just in case in order to not post 2 almost equal questions within minutes, ill include the most important part. 
  Summarizing, it should check:
  -The email field is not null
  -The email field has an @ (without taking into account order etc)</p>
  
  <p>Then it should tell if it found any problem, if not leave everything unchanged</p>
  
  <p>I hope i made my point, if not i can try to explain it again..</p>
  
  <pre><code> &lt;input type="text" name="email" id="email"&gt;
      &lt;input type="submit"  onclick=" proceed()"/&gt;
  &lt;script&gt;
      proceed(){
          var email= document.getElementById('email').value;
          var problems;
          if (email == ""){
              problems = "Empty variable \n";
  
          }
  
          var noat = true;
          for (int i=0; email.length; i++){
              if (email.charAt(i) == "@"){  //Compare each character
                  noat=false;
                  break;
              }
          }
  
          if (email=="" || noat=true){
              problems += "No @ \n"
              alert(problems);                        
          }
      }
  
  &lt;/script&gt;
  </code></pre>