Run a Function From a Form
<p>I want to add a function to a form, so when the submit button is clicked, a function is executed instead of leaving the page.</p>

<p>And I can not use $_POST, because I need the url.</p>

<p>Here is my script :</p>

<pre><code>function submitclicked()
    {
    echo 'Hello World'; 

    }
    &lt;form action="" method="post" id="TransactionAddForm"&gt;
    &lt;input type="hidden" id="TransactionAccountID" value="'.$zpid.'" name="data[Transaction][account_id]"&gt;
    &lt;input type="hidden" id="TransactionAmount" value="'.$_POST['price'].'" name="data[Transaction][amount]"&gt;
    &lt;input type="hidden" id="TransactionDesc" value="'.$desc.'" name="data[Transaction][desc]"&gt;
    &lt;input type="hidden" id="TransactionRedirectUrl" value="'.$backurl.'" name="data[Transaction][redirect_url]"&gt;
    &lt;div class="submit"&gt;&lt;input type="image" src="http://www.zarinpal.com/img/merchant/merchant-6.png" &gt;&lt;/div&gt;
    &lt;/form&gt;;
</code></pre>

<p>Tnx for your help.</p>
