Home › Forums › Calendar Products › Community Events › Follow up question re: add/remove required fields
- This topic has 7 replies, 2 voices, and was last updated 10 years, 2 months ago by Casey.
-
AuthorPosts
-
January 11, 2014 at 12:20 pm #90507irishrunner16Participant
Hey Casey,
One last question regarding my previous topic at https://theeventscalendar.com/support/forums/topic/how-to-make-certain-fields-required-on-submit-an-event-form/Would it be possible for you to list the files I’d need to edit to make this type of customization? I think I’d be able to attempt it myself…I’m just a bit confused as to what files I’d need to work with.
As always I appreciate the help. Thanks and have a great weekend!
– SeanJanuary 13, 2014 at 1:03 pm #91384CaseyParticipantSean,
Take a look at our themer’s guide to give you an idea about how the Events Calendar and Community templating system work.As far as adding required fields, you should be able to add something like this to your theme’s functions.php file to customize the fields that are required: https://gist.github.com/ckpicker/8407978
Then you can customize the error message by pasting this code into your theme’s functions.php file and modifying the HTML that gets displayed: https://gist.github.com/ckpicker/8408079
That should really be it, but let me know if you have further questions.
Thanks!
January 14, 2014 at 3:21 pm #92568irishrunner16ParticipantThis is great, thanks so much Casey! I’ve got the filter and html up, but I must have pulled an incorrect value in my “add_required_fields”, because the error message is showing up even when all req. fields have values. If you have a chance, could you confirm if one of the values below is incorrect?
function add_required_fields() {
return array(
‘post_content’,
‘post_title’,
‘event_taxonomy’,
‘EventStartDate’,
‘VenueVenue’,
‘VenueAddress’,
‘VenueCity’,
‘VenueCountry’,
‘StateProvinceSelect’,
‘VenueZip’,
‘OrganizerOrganizer’,
‘OrganizerEmail’,
);January 15, 2014 at 9:06 am #93041CaseyParticipantSean,
Try using ‘tribe_events_cat’ instead of ‘event_taxonomy’ and see if that does the trick. If that doesn’t work, I would just go through and add new values one at a time to find where the problem value is, and see if you can narrow it down to one incorrect value so we can troubleshoot further.Thanks!
-Casey-
January 15, 2014 at 7:15 pm #93344irishrunner16ParticipantHey Casey,
I tried using a bunch of different values (tried one at a time – see below for the complete list) but I’m getting the error message every time the form is submitted with values in all required fields. Not sure what I’m doing wrong, as I’ve tried a few different possibilities for some of the fields. But clearly I must be missing the correct one to pull from the modules! I’ve even triple checked to ensure the filters in my functions.php file are exactly as you included on https://theeventscalendar.com/change-required-fields-on-community-event-submission-page/. I’m perplexed!‘post_content’,
‘post_title’,
‘tribe_events_cat’, ‘event_taxonomy’,
‘EventStartDate’,
‘VenueVenue’, ‘venue_name’, ‘Venue Name’,
‘VenueAddress’,
‘VenueCity’,
‘VenueCountry’, ‘venue_country’, ‘EventCountry’,
‘StateProvinceSelect’,
‘VenueZip’,
‘OrganizerOrganizer’,
‘OrganizerEmail’,January 16, 2014 at 7:02 am #93484CaseyParticipantSean,
Ok, I’m still learning about this filter, since it’s relatively new, but I got a bit more information about it. Here are the field options that you can specify (they are case-sensitive):post_content EventStartDate EventStartHour EventStartMinute EventStartMeridian EventEndDate EventEndMinute EventEndHour EventEndMeridian is_recurring EventCurrencySymbol tax_input – For Event Categories Venue Organizer EventShowMapLink EventURL
Unfortunately with the way we handle Venues & Organizers, you can only specify that a name (or a saved item from the dropdown) was entered.
Note: if you have custom ECP fields that display on the form (screenshot), then you can even specify them as required. Just view the HTML source and find the correct <input> tag, and look for the ‘name’ attribute (screenshot).
Give those values a try and let me know if that does the trick.
Thanks!
-Casey-
January 16, 2014 at 7:48 am #93506irishrunner16ParticipantHey Casey,
Success! All of these field options worked perfectly. Thanks so much for taking the time to get this information together for myself and everyone else! Really appreciate you going above and beyond for us!January 16, 2014 at 7:50 am #93509CaseyParticipantGreat! Glad that did the trick! Let us know if you have other questions. We’re always happy to help! 😉
-Casey-
-
AuthorPosts
- The topic ‘Follow up question re: add/remove required fields’ is closed to new replies.