title: Using onclick and onsubmit together
body: <p>I want to perform an onclick and onsubmit at the same time, is this possible? Or if this is bad practice how can I merge the two codes to perform both events?</p>
  
  <p>I have this piece of code checking a mandatory field on the form tag:</p>
  
  <pre><code>onsubmit="return formCheck(this);"
  </code></pre>
  
  <p>I then have this piece of code on the submit button for the same form:</p>
  
  <pre><code>onClick="jQuery.facebox({ ajax: (\'wishlist.php?emailme=true&amp;name=\' + this.form.name.value + \'&amp;country=\' + this.form.country.value + \'&amp;email=\' + this.form.email.value + \'&amp;department=\' + this.form.department.value) }); return false;"
  </code></pre>
  
  <p>The problem I have is that on clicking the submit button it completely ignores the onsubmit code. How can I merge them together?</p>
  
  <p><strong>UPDATE I want it to check the mandatory fields first then send the form if all is ok.</strong></p>
  
  <p><strong>UPDATE: I've pasted the whole code <a href="http://pastebin.com/xzvHZvtA" rel="nofollow">here</a>, I'm really struggling as this was done by a previous developer. If someone could literally put the solutions into the code that would be great. I'll up the reward.</strong></p>