Error when I press the Enter key

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
josecristobal
User
Posts: 6

Error when I press the Enter key

Post by josecristobal »

I'm editing a table in which there is a picture field, and another text field. Strange error occurs if I click on the text field to edit and mistakenly pressed the Enter key, the image will automatically be deleted.


danielc
User
Posts: 1601

Post by danielc »

The browser tries to submit the form and triggers the "DELETE" button when you hit "enter". You may try to write your javascript to prevent or trigger form submission when ENTER is hit.


Webmaster
User
Posts: 9430

Post by Webmaster »

Set the button type as "button" explicitly so it will be treated as a submit button by browsers, you can use global Startup Script (see Server Events and Client Scripts in the help file), e.g.

$("button.delete").attr("type", "button");

Note that pressing Enter will still submit the form.


Post Reply