karsumit94 / phpliteadmin

Automatically exported from code.google.com/p/phpliteadmin
0 stars 0 forks source link

Edit form is not "Save Changes" by default : Unique conflict #215

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Create a table with a PK on one column (Integer for example)
2. Insert a row
3. Edit this row without modifying the PK
4. Submit the form by pressing enter from one of the inputs

The row should be updated and saved in the table.

But an error occurs saying the Primary Key must be UNIQUE.

Reason :
The form is built with 2 submit buttons, "Insert As New Row" and "Save Changes" 
- in that order. HTML selects the first submit button when submitted via the 
enter key from an input.
The action is actually seen as  "Insert As New Row" but the PK is the same as 
the existing one.

One solution would be to put the "Save Changes" first, and one might use CSS to 
make it appear on the right in order to keep the same appearance (floating?).

Another solution would be to remove the "Insert As New Row" and replace it with 
a checkbox.

Original issue reported on code.google.com by sherbrow...@gmail.com on 16 May 2013 at 1:49

GoogleCodeExporter commented 9 years ago
Valid issue and solutions.
I am not quite sure which one I prefer. Using CSS and switch positions has the 
disadvantage that some users might know the first submit-button is default and 
would expect different behaviour (although I guess most users don't know and 
expect the most logical behaviour).

The checkbox approach would be intuitive for everybody. I am just not sure I 
like to have a checkbox down there. (And you need an extra click if you want to 
create a new row.) But as this is a rather uncommon option, having a checkbox 
might be the best approach I guess.

Original comment by crazy4ch...@gmail.com on 16 May 2013 at 3:59

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r429.

Original comment by crazy4ch...@gmail.com on 24 Dec 2013 at 10:53

GoogleCodeExporter commented 9 years ago
I simply switched positions of the two buttons. I think it is intuitive like 
this as well and not a big deal that the button positions are switched now.

Original comment by crazy4ch...@gmail.com on 24 Dec 2013 at 10:54