Jump to content

don't want the enter key to send the email form


majeters

Recommended Posts

I'm very new at writing PHP code. I made an emailer form, and most of the input fields are optional. if the user accidentally hits the enter key, the form gets emailed. they then have to reinput the information in and send it again. I want to disable the enter key from sending and if possible I would rather the enter key move the cursor to the next field.

Link to comment
Share on other sites

You can't control that with PHP, that is browser behavior. At best you can try to use some sort of Javascript code to listen for keypress events and try to intercept the enter key. Most browsers by default have the enter key submit whatever form the cursor is in, that's not really something you can control.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...