Title: Conditional custom fields
Last modified: June 22, 2023

---

# Conditional custom fields

 *  Resolved [blanch80](https://wordpress.org/support/users/blanch80/)
 * (@blanch80)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/conditional-custom-fields-2/)
 * Hi,
 * Is it possible in some way to have conditional custom fields?
 * For example, a custom field is shown with options A, B and C. Depending on which
   option is selected from this custom field another custom field is shown.
 * If option A was selected, the new custom field could be a list of cities in England,
   if option B was selected, the new custom field could be a list of cities in Scotland
   and if option C was selected the new custom field could be a list of cities in
   Wales.
 * Is this possible, using custom fields/attributes in the plugin or using the ACF
   plugin?
 * Thanks,
   David.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [joneiseman](https://wordpress.org/support/users/joneiseman/)
 * (@joneiseman)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/conditional-custom-fields-2/#post-16841383)
 * Here’s some documentation on creating custom attributes: [https://wp-events-plugin.com/documentation/event-attributes/](https://wp-events-plugin.com/documentation/event-attributes/)
 * These are custom fields associated with the events.
 * You can modify the templates and make use of the event-attributes. Here’s how
   to modify template files: [https://wp-events-plugin.com/documentation/using-template-files/](https://wp-events-plugin.com/documentation/using-template-files/)
 * If you know php then you can modify the template files to have condititional 
   custom fields.
 * Here’s a post with an example of php to fill in a field using a dropdown list
   [https://wordpress.org/support/topic/dropdown-list-in-state-field/](https://wordpress.org/support/topic/dropdown-list-in-state-field/)
 *  Thread Starter [blanch80](https://wordpress.org/support/users/blanch80/)
 * (@blanch80)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/conditional-custom-fields-2/#post-16859340)
 * Hi,
 * Thanks for your reply. The last link isn’t really what I’m after. I’ve tried 
   this and it does change the state to a drop down rather than a free text box 
   but what I’m after is more on the user booking form.
 * So on the booking form the user is asked for their location.
 * If they choose England from the location field, they’re then presented with another
   drop down field with locations in England.
 * If they choose Scotland from the location field, they’re then presented with 
   another drop down field with locations in Scotland.
 * The more specific drop down list for areas within England and Scotland are hidden,
   and only show when an option is picked from the first field.
 * Is that possible?
   Thanks,
 * David.
 *  [joneiseman](https://wordpress.org/support/users/joneiseman/)
 * (@joneiseman)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/conditional-custom-fields-2/#post-16859472)
 * Yes, it’s definitely possible. In order to create a conditional form you would
   need to add JavaScript. Here’s an example: [https://stackoverflow.com/questions/26739340/conditional-logic-form/26740194#26740194](https://stackoverflow.com/questions/26739340/conditional-logic-form/26740194#26740194)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Conditional custom fields’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [joneiseman](https://wordpress.org/support/users/joneiseman/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/conditional-custom-fields-2/#post-16859472)
 * Status: resolved