title: javascript submit() not working
body: <p>Here is the form that is inside index.php -- I'm trying to programmatically submit it using a click on an image that's nested inside an 'a' anchor:</p>
  
  <pre><code>  &lt;form name="landingForm" id="landingFormId" method="post" action="index.php"&gt;
        &lt;input type="text" size="250" maxlength="250" 
                        id="artifactName"&gt;Enter an artifact name here...
        &lt;/input&gt;
        &lt;a href="javascript:document.landingForm.submit()"&gt;    
            &lt;img src="http://localhost/myProj/bronzeAgeCaveDrawing.jpg" 
                        alt="Submit this form" name="imageFormSubmitter" /&gt;
        &lt;/a&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>Here is my php code:</p>
  
  <pre><code>&lt;?php
      if(isset( $_POST['imageFormSubmitter']))
      {
         // this fx just echos a javascript 'alert()'
         showAlertBox("The index page form 'landingForm' was just submitted.");
      }
      else
      {
         var_dump($_GET);
         var_dump($_POST);
      }
    ?&gt;
  </code></pre>
  
  <p>When I type something in the edit box on the form, then click on the image 'bronzeAgeCaveDrawing.jpg' the dump of the GET and POST arrays says:</p>
  
  <pre><code>  array
        Empty
  
    array
        Empty
  </code></pre>
  
  <p>And for that matter I'm not even sure the above PHP code is getting called for the </p>
  
  <pre><code>      &lt;a href="javascript:document.landingForm.submit()"&gt;
  </code></pre>
  
  <p>case at all because the above php code executes regardless of whether the form submits -- the GET and POST
  dumps occur when index.php loads due to the 'else' clause above that I added because it didn't appear that the 'if' clause was happening.</p>
  
  <p>If the above php code IS in fact executing by the submit() call, the GET and POST are still empty arrays.</p>
  
  <p>I studied examples of using an anchor 'a' with an image combined with a call to submit() in a few posts on SO and I don't see any reason why the POST or GET array is empty.   And due to my form method="post" I'm 100% expecting for the submit() to POST the form, not submit with a GET.  </p>
  
  <p>Been staring at this awhile -- am I missing something? </p>
  
  <p><strong>UPDATE:</strong>  Here is the functioning code -- thanks for your help folks!</p>
  
  <pre><code>    &lt;form name="landingForm" id="landingFormId" method="post" action="index.php"&gt;
        &lt;input type="text" size="250" maxlength="250"  name="itemName_name"
                        id="artifactName"&gt;Enter an artifact name here...
        &lt;/input&gt; 
        &lt;a href="javascript: document.landingForm.submit()"&gt;    
            &lt;img src="http://localhost/myProj/bronzeAgeCaveDrawing.jpg" 
                   alt="Submit this form" name="imageFormSubmitter" /&gt;
        &lt;/a&gt;
      &lt;/form&gt;
  
  
     if(isset( $_POST['itemName_name']))
     {
           showAlertBox("The index page form 'landingForm' was just submitted.");
           var_dump($_POST);
     }
  </code></pre>
  
  <p>Output of the dump of POST array <strong><em>NOW</em></strong> shows:</p>
  
  <pre><code>   array
         'itemName_name' =&gt; string 'fffffffffff' (length=11)
  </code></pre>
  
  <p>TAKEAWAYS:  </p>
  
  <pre><code>1) the syntax "document.landingForm.submit()" is 100% fine.
  2) the 'name' attribute of my &lt;img&gt; tag does NOT get posted (not sure why,
        but it's not the worst thing happening for me right now so I'll deal with it)
  3) giving the text &lt;input&gt; field a 'name' attribute made its way fine to the POST array.
  4) the call to submit() does in fact pay attention to the method="post" in my 
     form declaration.
  </code></pre>
  
  <p>I'm running with it, thanks all.  There is more than one equally acceptable answer for me, so I'll +1 y'all
  then have to choose one.  Thanks again.</p>