checking fields before creating an item

オフライン

hello,

i have created an itemtype, when i create an item of this type the forms contains couples of field. for each couples i need to check if one of the item as a value the other one should too.

i had an idea of using a method on before add, check if the couples respect the rule i want and if not i want to cancel the creation of the part and have the user fix the missing value.

let me know if you think of a beter way or if u know how to cancel the creation of an item on an on before add event.

thanks.

Lucas