How can I stop a duplicate entry being created & provide feedback?
What about not showing the submit button at all, if a similar booking already exists?

{% if currentUser|length %}
    {% if entry.dateTime &gt; now %} {# If event is in the future, display button to book #}

        {% set similarBooking = craft.entries({ sectionId: '18', relatedTo: ['and', { targetElement: currentUser, field: 'userBooking' }, { targetElement: entry.id, field: 'eventBooking' } ]}) %}
        {% set totalBookings = craft.entries({ sectionId: '18', relatedTo: { targetElement: entry.id, field: 'eventBooking' } }) %}

        {% if similarBooking|length %} {# Check if they have already booked #}
            &lt;p&gt;You have already booked a place for this event.&lt;/p&gt;
        {% else %} {# No previous booking, so check if there are spaces #}

            {% if entry.maxBookings &gt; 0 %} {# Check if there is a limit on spaces #}

                {% if totalBookings|length &lt; entry.maxBookings %} {# Check if there are spaces left #}
                    &lt;a href="#"&gt;Book Now&lt;/a&gt;
                {% else %} {# There are no spaces left #}
                    &lt;p&gt;This event is full.&lt;/p&gt;
                {% endif %}

            {% else %} {# No limit, display booking button #}
                &lt;a href="#"&gt;Book Now&lt;/a&gt;
            {% endif %}

        {% endif %}

    {% endif %}

{% else %}
    &lt;a href="#"&gt;Login to book&lt;/a&gt;
{% endif %}