title: Problem submitting a form using onclick
body: <p>I'm having a problem submitting my form, my code is as follows:</p>
  
  <pre><code>&lt;form method="get" action="&lt;?=bloginfo('template_url');?&gt;/contact.php" id="quickContactForm" onsubmit="return sendDetails();"&gt;                  
                      &lt;h2&gt;Request a callback:&lt;/h2&gt;
                      &lt;ul style="margin:10px"&gt;
                          &lt;li style="list-style-type:none;"&gt;
                              &lt;label&gt;Name:&lt;/label&gt;
                              &lt;input name="name" id="name" type="text" style="margin-left:12px; height:20px; margin-bottom:5px;"&gt;
                          &lt;/li&gt;
  
                          &lt;li style="list-style-type:none;"&gt;
                              &lt;label&gt;Email:&lt;/label&gt;
                              &lt;input name="email" id="email" type="text" style="margin-left:14px; height:20px; margin-bottom:5px;"&gt;
                          &lt;/li&gt;
  
                          &lt;li style="list-style-type:none;"&gt;
                              &lt;label&gt;Mobile:&lt;/label&gt;
                              &lt;input name="mobile" id="mobile" type="text" style="margin-left:8px; height:20px; margin-bottom:5px;"&gt;
                          &lt;/li&gt;
  
                          &lt;li style="list-style-type:none;"&gt;
                              &lt;label&gt;Note:&lt;/label&gt;
                              &lt;input name="interest" id="interest" type="textarea" style="margin-left:20px; height:100px"&gt;
                          &lt;/li&gt;
  
                          &lt;li style="list-style-type:none;"&gt;
                              &lt;a href="javascript: void(0)" onclick="document['quickContactForm'].submit()" class=""&gt;
                                  &lt;img src="&lt;?=bloginfo('template_url');?&gt;/images/btn_send.jpg" /&gt;
                              &lt;/a&gt;
                          &lt;/li&gt;
                      &lt;/ul&gt;   
                  &lt;/form&gt;
  </code></pre>
  
  <p>The above code gives me an error: document.quickContactForm is undefined I've also tried changing the  tag to:</p>
  
  <pre><code>&lt;a href="javascript: void(0)" onclick="$('#quickContactForm').submit()" class=""&gt;
      &lt;img src="&lt;?=bloginfo('template_url');?&gt;/images/btn_send.jpg" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>but this gives me an error aswell: $ is not defined</p>
  
  <p>What am I doing wrong ?</p>
  
  <p>Regards,
  Stephen</p>