Event submission form: remove dropdown list of US states

Home Forums Calendar Products Community Events Event submission form: remove dropdown list of US states

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #905184
    Rafael
    Participant

    Hello support
    I’ve set the default country to Switzerland, but on the event submission form the “State” field still appears with a dropdown list of US states. Shouldn’t this field automatically be deactivated? How can I remove it?

    #905401
    George
    Participant

    Hey Rafael,

    Sorry for any frustration here – I tested out this issue by setting a non-USA default country in my own installation, and found the same thing: the country changed, but the US states remained.

    I agree that this isn’t the behavior you might expect, and that hiding the US states if the US isn’t the default country is a good idea – it’s definitely worth exploring and I’ll bring it up in a support meeting.

    However, completely removing this input might not be a great idea. The dropdown is for both states and provinces, depending on the selected country, so unless you’re 100% certain that no submissions will ever need this state/province specification for their venues, I would not recommending removing this code.

    If you realize the possible limitations that this could have on your submissions form, and still want to remove the US States drop-down, no worries – you can do this right within your theme. First, check out the official Themer’s Guide here to learn how to customize Events Calendar PRO views. The same principles apply for add-ons like Community Events. The Themer’s Guide can be found here → https://theeventscalendar.com/support/documentation/events-calendar-themers-guide/

    Once you explore that guide completely, you can head into the plugin files for the Community Events add-on on your site. You should be looking for the following file:

    the-events-calendar-community-events/views/community/modules/venue.php

    Once you find this, copy and paste it into the file you created as directed by the Themer’s Guide above, and head to around line 121 or so in the code. You should find an input element with its ID set to “StateProvinceText”. If you remove this input and its labels, the “State or Province” dropdown will be removed from your events submission form regardless of the default country.

     

    #905698
    Rafael
    Participant

    Hey George,
    Thank you very much for your prompt and elaborate response. Since I’m using the plugin only for events in Switzerland, I have no need for the dropdown list of US-States. Using your instructions I’ve successfully removed that dropdown list, while keeping the State input field so people can enter that information by hand. My issue is now resolved. Thanks for your help.

    #906913
    George
    Participant

    Glad to hear it Rafael! Thanks for the update.

    Best of luck with your project – if you have any other questions or concerns related to it, feel free to open another ticket on these forums anytime. For now, I’ll close up this ticket here.

    Cheers,
    George

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Event submission form: remove dropdown list of US states’ is closed to new replies.