Re: Trap CR or "Enter" possible?
| From: | Erik Price | Date: | Fri, 22 Mar 2002 17:42:06 +0000 |
| Subject: | Re: Trap CR or "Enter" possible? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-89714@lists.php.net to get a copy of this message | ||
On Friday, March 22, 2002, at 12:29 PM, Jason Wong wrote:
Right, but I was trying to come up with a way for the original poster to test to see if the user had simply hit "enter" or if they had actually hit the "submit" button (not as a test to see if the form was being viewed for the first time). IIRC he was having problems determining whether or not the user had hit "enter" or hit the submit button. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.comSide note to the original poster: in the script that is the target of the form you are writing, you may be able to test for the presence of the "submit" variable -- if this value is not present, then the user has not clicked the Submit button. I know that the "value" of a submit input is usually just used to label the button in some way (such as value="Click Here for Free Porn!"), but you can actually test for this value if you have given the Submit input a name. I may be wrong about this, though.Thus if you relied upon testing for the value of the submit button to determine whether the form had been submitted (as opposed to being viewed for the first time) then you're going to get unexpected results.