You are here: Re: hitting enter on a form instead of clicking the button « HTML « IT news, forums, messages
Re: hitting enter on a form instead of clicking the button

Posted by Paul Furman on 03/15/07 22:26

Iván Sánchez Ortega wrote:
> Paul Furman wrote:
>
>
>>I'm getting incorrect response when hitting the enter key instead of
>>actually clicking the button on a form. It activates but the post data
>>[value='Update'] isn't being sent I think. The php generated page
>>flickers & reloads but doesn't perform the update.
>
>
> That's the way it works - The name/value pair of a submit button only gets
> submitted if the button is actualy pressed.
>
> If you want to have some data every time a form is submitted, rely on <input
> type='hidden'/> fields.
>
> (Check the W3.org HTML reference for more details).

I'm not sure why it worked before in the one case but THANKS!

I added:
<input type='hidden' name='buy' value='Update'>

on top of the old:
<input type='submit' name='buy' value='whatever'>

and it works!

The test is simply:
if (isset($_REQUEST["buy"])) {

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация