Re: Re: value submit button
| From: | Justin French | Date: | Fri, 01 Aug 2003 05:07:26 +0000 |
| Subject: | Re: Re: value submit button | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157877@lists.php.net to get a copy of this message | ||
Do some testing in a few browsers to see what happens when the user hits "enter" or "return", rather than clicking on the button(s)... I *think* you need to put in a hidden element. For example, if you wanted "submit2" to be the default value:
<?=$_POST[submit]?>
<form method="post">
<input type="hidden" name="submit" value="submit2" />
<input type="submit" name="submit" value="submit1" />
<input type="submit" name="submit" value="submit2" />
</form>
Justin
On Friday, August 1, 2003, at 02:36 PM, hu zhenghui wrote:
You can get the button value use code below: <?php echo $_POST[submit];?> <form method="post"> <input type="submit" name="submit" value="submit1"> <input type="submit" name="submit" value="submit2"> </form>