Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created June 23, 2021 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/51510374b1f8cb91b8b4450a86ca8a6c to your computer and use it in GitHub Desktop.
Save Pebblo/51510374b1f8cb91b8b4450a86ca8a6c to your computer and use it in GitHub Desktop.
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