Go Back   Forum Care Forums > Development Reference Area > Php Development

Reply
 
LinkBack Thread Tools Display Modes
Hitting Enter on a form before it is filled out
Old
  (#1)
Guest
Guest
 
Posts: n/a
Default Hitting Enter on a form before it is filled out - 06-02-2007, 08:55 PM

Hi, I'd like to know what a PHP would look like to "catch" a form that
was not completly filled out but they hit Enter and the form
terminates. Thanks in advance.

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Hitting Enter on a form before it is filled out
Old
  (#2)
petersprc
Guest
 
Posts: n/a
Default Re: Hitting Enter on a form before it is filled out - 06-02-2007, 08:55 PM

In PHP, you could check like so:

if (!isset($_REQUEST['name'])) {
die('Name is required.');
}

You can do it on the client side with javascript like so:

http://www.yourhtmlsource.com/javasc...alidation.html

On May 28, 3:56 pm, "Mr.G (@¿@)" <goo...@netzero.net> wrote:
> Hi, I'd like to know what a PHP would look like to "catch" a form that
> was not completly filled out but they hit Enter and the form
> terminates. Thanks in advance.



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Hitting Enter on a form before it is filled out
Old
  (#3)
Guest
Guest
 
Posts: n/a
Default Re: Hitting Enter on a form before it is filled out - 06-02-2007, 08:55 PM

On May 28, 5:55 pm, petersprc <peters...@gmail.com> wrote:
> In PHP, you could check like so:
>
> if (!isset($_REQUEST['name'])) {
> die('Name is required.');
>
> }
>
> You can do it on the client side with javascript like so:
>
> http://www.yourhtmlsource.com/javasc...alidation.html
>
> On May 28, 3:56 pm, "Mr.G (@¿@)" <goo...@netzero.net> wrote:
>
> > Hi, I'd like to know what a PHP would look like to "catch" a form that
> > was not completly filled out but they hit Enter and the form
> > terminates. Thanks in advance.


But if Javascript is turned off you have a problem.

Next to submit I put a "finished" checkbox, that way if it isn't
checked I know not to act on the entry (just in case it was a mis-
entry or they want to test validation before finalizing.)

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top