1 input form and 2 methodS

<form [COLOR="Blue"]method='post'[/COLOR] action='action1.php'>

<textarea name='message'></textarea>
<input type='submit' value='action1'>
<input type='submit' value='action2'  onClick="this.form.action='action2.php'">

</form>

With the code above,
if a user clicks action1 button, it will go to action1.php
if a user clicks action2 button, it will go to action2.php

In Both the action1.php and the action2.php, I can get the value of user’s message with $_POST[‘message’].

I like to make it like the follow.

In the action1.php, I liket to get the value of user’s message with $_POST[‘message’].

In the action2.php, I liket to get the value of user’s message with $_GET[‘message’].

The code below doesn’t work correctly, but I hope it shows what I want.

<form [COLOR="Blue"]method='post'[/COLOR] action='action1.php'>

<textarea name='message'></textarea>
<input type='submit' value='action1'>
<input type='submit' value='action2'  
[COLOR="Red"]method="get" [/COLOR]onClick="this.form.action='action2.php'">

</form>

Try this:


<input type='submit' value='action2'  
onClick="this.form.action='action2.php'; this.form.method='get'">

Thank you, prasanthmj. it works fine.