Form submit to run javascript and then post to php script
<p>I am currently working on a php/html/javascript project. I have a form where when the user presses the submit button, it should run a javascript function and then afterwards post to a php page to process the data that was submitted in the form.</p>

<p>I have the form run a javascript method as below</p>

<pre><code>&lt;form class="form" id="addImageForm" name="addImageForm" action="javascript:validateAddImage();" method="post"&gt;
</code></pre>

<p>The method validates the form, calls another method and then it submits the form using <code>document.myForm.submit();</code> </p>

<p>How do I get it to submit the form to another php page to process the data including upload selected files.</p>

<p>Thanks for any help you can provide. </p>
