Supressing Default Enter Key Behavior

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
octopusgrabbus
Forum Newbie
Posts: 7
Joined: Tue Jan 13, 2009 1:10 pm

Supressing Default Enter Key Behavior

Post by octopusgrabbus »

I am a PHP Newbie. I have a sample PHP form that submits to itself, when the value of a text field (containing an amount for a charitable donation) changes. At this point a random sequence number is generated and a time stamp captured. Along with an API login and "key", and MD5 call is made from these values to create a fingerprint. When the user presses the "submit" button after entering a dollar amount, then the page transmits the form to a payment processor's web site.

My problem is I need to prevent pressing the Enter key from submitting the form too early. Is it possible to suppress the default Enter key behavior in this form, without submitting to a PHP function? Or, is the best way to go to write a function?

Thanks.
cmn
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Supressing Default Enter Key Behavior

Post by papa »

Post Reply