title: Need to submit a form without the onsubmit and include the action
body: <p>Here is a form</p>
  
  <pre><code>&lt;cfoutput&gt;
  &lt;form name    = "xrefform" 
      id        = "xrefform"
      action    = ""
      method    = "post"         
      onsubmit  = "return submitx('#coltop#', '#col#')"&gt;
  &lt;/cfoutput&gt;
  </code></pre>
  
  <p>There are two different way to submit it:
  1) when you want the data in the form to be placed in a MySql Table
  2) when you want the data to be deleted from the Mysql Table</p>
  
  <p>For the first case I have</p>
  
  <pre><code>&lt;input type     = "Submit"
          name    = "SubmitXref" 
          class   = "submitbut" 
          value   = "Submit"            
          onclick = "aasubmit('xref2.cfm')"&gt;
  </code></pre>
  
  <p>with corresponding javascript:</p>
  
  <pre><code> function aasubmit(target) {
     document.xrefform.action = target;
   }//end function aasubmit
  </code></pre>
  
  <p>This works fine.</p>
  
  <p>For the delete case I have</p>
  
  <pre><code>&lt;input   type    = "Submit"
           id      = "delbut" 
           class   = "onoffbut" 
           value   = "delete"             
           onclick = "aasubmit('repdel.cfm')"&gt;
  </code></pre>
  
  <p>This has a problem, which is that the submitx() javascript runs, and in this case I don't want it to. </p>
  
  <p>I find references that say using the document.form.submit() method will avoid running the onsubmit function.  But I can't figure out how to indicate the action.  </p>
  
  <p>Can someone show me how to do this?  </p>
  
  <hr>
  
  <p>After fussing around some more I found the answer:</p>
  
  <p>For the delete button --which needs to evade the onsubmit script --here is the HTML: </p>
  
  <pre><code>   &lt;input type    = "button"
          id      = "delbut"              
          value   = "Delete this item"
          onclick = "buttonsubmit('xrefdel.cfm', 'xrefform')"&gt;
  </code></pre>
  
  <p>And here is the javascript.</p>
  
  <pre><code>function buttonsubmit(target, source) {
  var q = document.getElementById(source);  
  q.action = target;
  q.submit();
  }
  </code></pre>
  
  <p>This works perfectly.  The ordinary submit honors the onsubmit script, the delete button skips it.</p>