Event form Email format verification

Home Forums Calendar Products Community Events Event form Email format verification

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #31927
    clubbingpriest
    Participant

    How to have a email verification format on the email field of the organizer section, right now we can enter anything without @domain.com and the form accept it
    Please advise
    JEAN LOUIS

    #31955
    Casey
    Participant

    Thanks for reaching out! You can use some jQuery to validate the email address when the submit button is clicked.

    First, you’ll need to perform a template override and putting a copy of event-form.php into this directory: ‘YOUR_THEME_DIR/events/community/’.

    Then add this inside the script block on line 18:

    https://gist.github.com/4692585

    Let me know if that gets the job done. Thanks!

    #32009
    clubbingpriest
    Participant

    HI Casey
    I did add the jQuery script on the event-form.php but the function did Here the code

    jQuery(‘.events-community-submit’).click(function() {
    var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&’\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&’\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
    if(jQuery(‘#OrganizerEmail’).val() != “”) {
    if(!pattern.test(jQuery(‘#OrganizerEmail’).val())) {
    alert(‘Please enter a valid email address.’);
    jQuery(‘#OrganizerEmail’).select();
    jQuery(‘#OrganizerEmail’).focus();
    return false;
    }
    }
    });

    jQuery(document).ready(function() {
    jQuery(‘#show_hidden_categories’).click(function() {
    //jQuery(‘#event-categories’).css(‘overflow-y’, ‘scroll’);
    jQuery(‘.hidden_category’).show(‘medium’);
    jQuery(‘#show_hidden_categories’).hide();
    return false;

    });
    //Code to select desired default hour
    jQuery(‘select[name=”EventStartHour”]’).val(’23’);
    jQuery(‘select[name=”EventEndHour”]’).val(’06’);
    });

    …..etc….

    #32014
    clubbingpriest
    Participant

    Sorry I did not finish my message
    I inserted the jQuery but the function do not work

    #32103
    Casey
    Participant

    Jean,
    Try replacing your entire event-form.php file with this: https://gist.github.com/4710137

    Let me know if that does the trick. Thanks!

    #32129
    clubbingpriest
    Participant

    HI Casey,
    Thank you this is working

    #32135
    Casey
    Participant

    Thanks for confirming that this got you sorted. Unless you disagree, I’m going to mark this thread “Answered” and close it out.

    We really appreciate your support and please let us know if you need anything else in the future. If you find yourself with a few minutes and would be so kind as to give us a “Works” rating or a positive star voting on the WordPress.org repo (http://wordpress.org/extend/plugins/the-events-calendar/), or even a shoutout to your followers on Facebook or Twitter, it would mean a lot to us. Thanks again for using the plugin.

    #978550
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Event form Email format verification’ is closed to new replies.