Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created Jun 23, 2021
Embed
What would you like to do?
jQuery(document).ready(function ($) {
$ ('#spco-go-to-step-payment_options-submit').on('click', function (e) {
e.preventDefault();
e.stopPropagation();
var email = $('.ee-reg-qstn-email input').val();
var event = $('.big-event-title-hdr').attr('id');
event = event.substr(12); // this gets the event id from the heading id attribute
$.ajax(
{
url: postdetails.ajax_url,
type: 'post',
data: {
action: 'my_action',
user_email: email,
event_id: event
},
success: function (response) {
if (response == 'false')
{
$ ('#ee-spco-attendee_information-reg-step-form'). submit ();
}
else
{
alert ('You have already registered for this run with this email address. Please use a different email address or contact us at office@meinstartplatz.at.');
}
},
error: function ()
{
alert ('An error has occurred. Please contact us at office@meinstartplatz.at.');
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment