Issues with Add Event Form: Validation, Field Labels

Home Forums Calendar Products Community Events Issues with Add Event Form: Validation, Field Labels

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1319777
    Kamala
    Participant

    Having an issue trying to get the Community Events add-on to work as required. Also, have one question regarding field labels.

    1. Required Email Field Validation: I have made the organizer’s email field required on the Add Event form as per this article: https://theeventscalendar.com/knowledgebase/required-fields-for-events-submission-form/.

      Code in our functions.php is:

      
      add_filter( 'tribe_events_community_required_fields', 'mark_twain_country_event_required_fields', 10, 1 );
      function mark_twain_country_event_required_fields( $fields ) {   
          if ( ! is_array( $fields ) ) {
              return $fields;
          }
          $fields[] = 'Organizer';
          $fields[] = 'Email';
          return $fields;
      } 
      

      I enter a valid email address in the Organizer’s email field and expect the form submission to be validated. However, get the error message “Email is required” and the form is not submitted.

    2. Is there a way to change the field label under Venue from “Postal Code” to “Zip Code”?

    Thank you in advance for your help.

    • This topic was modified 6 years, 9 months ago by Kamala.
    • This topic was modified 6 years, 8 months ago by Shelby.
    #1320339
    Shelby
    Participant

    Hey there,

    Thanks for posting, & Iโ€™m happy to help. ๐Ÿ™‚

    I’m going to be doing some work on my testing server, but I wanted to give you a heads up that this kind of request *might* require some customization that we can’t provide on these forums. We’ll have to see.

    However, we do have some resources for guidance making theme customizationsย here. ย I’d suggest checking that guide out while I work on things on my end. If you end up needing to find someone to help with the customizations, we also have some tips for finding help here.

    Hope this helps, and thanks for your patience!

    Best,

    Shelby ๐Ÿ™‚

    #1321685
    Shelby
    Participant

    Hi there,

    Could you try this instead and see if it resolves the issues you’re having?

    add_filter( 'tribe_events_community_required_fields', 10, 1 );
    
    function my_community_required_fields( $fields ) {
    
    if ( ! is_array( $fields ) ) {
     return $fields;
     }
    $fields[] = 'Organizer'; 
    $fields[] = 'Email'; 
    return $fields;
    }

    Best,

    Shelby ๐Ÿ™‚

    #1322390
    Kamala
    Participant

    Hi Shelby,

    I just got a chance to try that code snippet you sent. Unfortunately, it
    doesn’t work:

    – I fill in the email field, click submit, and “Email required” error
    message is still displayed.

    By the way, I had already tried that code you sent as well as different
    variations…

    Regards,

    Cindy


    ——————————————–
    Cindy Lutz
    Membee / IRM Systems Inc.
    800.729.2962 (toll free) ext. 429
    403.250.8366 (fax)
    Site: http://www.membee.com
    ———————————————

    Membee – The Hardworking Membership Management System from IRM Systems.
    Celebrating 20 years of serving non-profits.

    Heard the latest buzz about Membee? Visit our blog and sign up for email
    notifications at http://blog.membee.com.

    #1323257
    Shelby
    Participant

    Hey again Cindy,

    I reached out to some of our team, and as it turns out, we had some updates made to the knowledgebase article you referenced in your initial post. So, try the following code instead. ๐Ÿ™‚ If it doesn’t work, I’ll follow up with the person who updated it this week :

    add_filter( 'tribe_events_community_required_organizer_fields', 'my_organizer_community_required_fields', 10, 1 );
    
    function my_organizer_community_required_fields( $fields ) {
     
     if ( ! is_array( $fields ) ) {
     return $fields;
     }
    
    $fields[] = 'email';
    
    return $fields;
    }

    Let me know how that goes!

    Best,

    Shelby ๐Ÿ™‚

    #1328525
    Kamala
    Participant

    Hi Shelby,

    Unfortunately the latest snippet you sent for me to try does not work either.

    #1328555
    Shelby
    Participant

    Hi Again,

    Unfortunately Cindy, I believe the code isn’t working because of a theme or plugin conflict. Could you test that theory by working through the steps in this documentation?

    Let me know how that goes!

    Best,

    Shelby ๐Ÿ™‚

    #1330091
    Kamala
    Participant

    Hi Shelby,

    There is no conflict. I switched to the Twenty Seventeen theme and disabled all plugins except for the two Events Calendar plugins. Still, the required organizer name and email fields are not validating as expected.

    I tested these three combinations of code snippets in functions.php:

    1. This does absolutely nothing, even though your documentation says it should require all Organizer fields be required. The form submitted as valid with only Event Title and Event Description filled in.
      add_filter( ‘tribe_events_community_required_fields’, ‘my_community_required_fields’, 10, 1 );
      function my_community_required_fields( $fields ) {
      if ( ! is_array( $fields ) ) {
      return $fields;
      }
      $fields[] = ‘organizer’;
      return $fields;
      }
    2. This latest code snippet you sent me does not work either. The form submitted as valid with only Event Title and Event Description filled in. add_filter( ‘tribe_events_community_required_organizer_fields’, ‘my_organizer_community_required_fields’, 10, 1 );
      function my_organizer_community_required_fields( $fields ) {
      if ( ! is_array( $fields ) ) {
      return $fields;
      }
      $fields[] = ’email’;
      return $fields;
      }
    3. Also tested by pasting both of the snippets into functions.php. That time the form would not validate even though all required fields were filled in.

    This is getting extremely frustrating. I’ve spent hours on trying to get this minor thing to work. Have you been able to replicate it?

    Cindy

    #1332560
    Shelby
    Participant

    Hi Cindy,

    Thanks for your patience. I was out at the end of last week, so thanks for hanging in there! I’m going to take a look at this tomorrow and try to replicate yet again. This one is really bugging me, and I can imagine how frustrating it is for you!

    Look for a follow up on this tomorrow.

    Thanks,

    Shelby

    #1333600
    Shelby
    Participant

    Hi again Cindy,

    I’m still not seeing these issues, BUT I have consulted with Brian to see if he can help me out with updating the snippet he wrote that was part of a previous thread and of the knowledgebase article, so hang tight and I’ll let you know when I get that back from him. ๐Ÿ™‚

    Best,

    Shelby ๐Ÿ™‚

    #1334578
    Shelby
    Participant

    Hi Cindy,

    I heard back from Brian, and as it turns out, he’s taking some time off, so I’m seeking out help from other teammates. Thanks for hanging in there! I will let you know when I get assistance with this snippet.

    Cheers,

    Shelby ๐Ÿ™‚

    #1349374
    Kamala
    Participant

    Hi Shelby – Any news on this ticket?

    #1362969
    Victor
    Keymaster

    Hello Cindy!

    First, I wanted to apologise for taking so long getting back to you. Shelby no longer works with us and this thread has gone out of our radar until today somehow.

    I went over this thread to catch up with your issue, so let me try to help you with this.

    I have been able to make the organizer Email required by placing the following snippet into the active theme’s functions.php file:

    add_filter( 'tribe_events_community_required_fields', 'my_community_required_fields', 10, 1 );
    
    function my_community_required_fields( $fields ) {
    
    if ( ! is_array( $fields ) ) {
     return $fields;
     }
    
    $fields[] = 'organizer';
    
    return $fields;
    }
    
    add_filter( 'tribe_events_community_required_organizer_fields', 'my_organizer_community_required_fields', 10, 1 );
    
    function my_organizer_community_required_fields( $fields ) {
     
     if ( ! is_array( $fields ) ) {
     return $fields;
     }
    
    $fields[] = 'Email';
    
    return $fields;
    }

    This will require the organizer to be assigned to the event and also require the Organizer Name and Email.

    Please try it out and let us know if it works for you.

    Thanks,
    Victor

    #1374754
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Issues with Add Event Form: Validation, Field Labels’ is closed to new replies.