Is there a way to prevent duplicate entry in editor with 2 fields ?
Is there a way to prevent duplicate entry in editor with 2 fields ?
Mairie du Pecq
Posts: 14Questions: 4Answers: 0
Hi,
I am seeking if it's possible to add control when a user add duplicate values.
I use Datatables and Editor and when i add a new entrie with the firstname, lastname and other stuffs, i would like to check if the firstname and lastname already exist before insert or update the database.
I thinck i need to use "postCreate" and "postEdit" but could you please confirm it to me.
This question has an accepted answers - jump to answer
Answers
A validator would be the way to do this. If you were checking with just a single column you could use the pre-build
unique
validator, but since you have two fields, you'd need to query the database manually to check if there is already matching data.A few notes about this:
create
actionAllan