# Help with validation code

**URL:** <https://forums.knack.com/t/help-with-validation-code/6958>\
**Category:** API & Custom Code\
**Created:** [September 19, 2018, 3:38pm UTC](https://forums.knack.com/t/help-with-validation-code/6958 "2018-09-19T15:38:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JulianKirkness](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/juliankirkness/32/770_2.png) [@JulianKirkness](https://forums.knack.com/u/JulianKirkness)\
**Post date:** [September 19, 2018, 3:38pm UTC](https://forums.knack.com/t/help-with-validation-code/6958/1 "2018-09-19T15:38:40Z")

</div>

I have an app in which a person (logged in user) can book themselves onto an event and am trying to find out how to prevent them from booking the same event twice - does anyone have any code which would do this??

The Objects are:

User

Event

Booking

As I see it there are two ideal options, firstly to remove events they are already booked on from the dropdown or, when the event is selected and is a duplicate, give them a message and clear their selection. In neither case should it be possible to save the record.

---

<div class="post-metadata">

**Author:** ![Mark](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@Mark](https://forums.knack.com/u/Mark)\
**Post date:** [October 8, 2021, 6:13pm UTC](https://forums.knack.com/t/help-with-validation-code/6958/2 "2021-10-08T18:13:22Z")

</div>

Julian,  
Did anyone in the community, or from Knack get back to you with a solution to this? I can’t find a thread?
