Avoid exceeding certain number of duplicates

Avoid exceeding certain number of duplicates

Manuel PerezManuel Perez Posts: 1Questions: 1Answers: 0


I'm new at code developing and I want to know if you can help me.

Is there a way to achieve avoiding to create a new register using datatables when the value has repeated a certain number of times (lets say 3 times). This is because I want to allow to use a referal ID no more than this number of times.


  • allanallan Posts: 52,493Questions: 1Answers: 8,010 Site admin

    Assuming that you are using Editor, you would need to create a custom validator. The provided database validator only checks for duplicates. In your case you'd need to select the count of the matching number of rows.


  • colincolin Posts: 9,520Questions: 0Answers: 1,576

    Hi @Manuel Perez ,

    You can use the API call row().delete() to delete rows once the table has been initialised, or you could use jQuery and remove it from the DOM.

    Hope that helps,



This discussion has been closed.