Validator. Detect repeated values

Validator. Detect repeated values

danielrm79danielrm79 Posts: 6Questions: 3Answers: 0

Hello, i'm using datatables to show a list of ítems. Only one record of the whole list can have the value "yes" for a specific field. The rest of records must have the "no" value for that field. So, if one record have the value "yes" for the field, and i try to set that field to the "yes" value for another one record, the validator must say "Incorrect. Only one record allowed to be "yes". How can i do it with the validator? Thanks.

Answers

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    Assuming you are using the PHP libraries for Editor, the unique() validator is the way to do this. The .NET libraries also have a similar method if you are using them.

    Regards,
    Allan

This discussion has been closed.