Here is my scenario :
I have a html form on my main page where user can enter the data and and submitting the form using post method.
<form id="main" name="main" action="#text" method="post" >
//codes goes here
<input id="generate" type="submit" name="script" value="create output" />
</form>
And the PHP code to process above form is
<?php
echo '<form action="#text" method="post">';
echo '<textarea onclick="this.select()" name="output_textarea" id="output_textarea" cols="100" rows="25" readonly>';
//above form inputs will echo in this textarea
<-------PHP codes for download here---->
<-------PHP codes for email here---->
<input type="submit" id="download" value="Download" name="download"></input>
<input type="submit" id="send" value="send" name="send"></input>
echo '</textarea>';
echo '</form>';
?>
I am echoing the form output to a textarea and I need to have a download button a email button
to save\send the textarea. Here is issue I am facing is both the submit buttons on the second page executing download php function, not email.
So, How can I assign two separate functions for two submit functions ? download and email ?
I am not using separate php page here instead of that using php code on the same page where I add html.