Re: PHP and FORM

From: Date: Sat, 09 Oct 2004 12:53:25 +0000
Subject: Re: PHP and FORM
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-199067@lists.php.net to get a copy of this message
On Sat, 9 Oct 2004 08:41:38 -0400, php mysql <pmysql@gmail.com> wrote: > I'm writing form using PHP and HTML. The form is submited only if user > clicks on submit button. However, it's not possible to submit form > when I press "enter". Is it possible to submit form pressing on > enter? If so how? You can submit the form with pressing enter if the field you are focusing on when you press enter is inside your <form> tags. The thing then is that on the parsing side you must actually test for that field of the $_POST array, like so: <?php if(isset($_POST['my_text_field']) || isset($_POST['submit'])){ // do whatever } ?> <form method="post" action="index.php"> <input type="text" name="my_text_field"> <input type="submit" name="sumit" value="Submit"> </form> -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/

« previous php.general (#199067) next »