{"id":794660,"date":"2014-10-07T12:39:27","date_gmt":"2014-10-07T19:39:27","guid":{"rendered":"https:\/\/tri.be\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/"},"modified":"2014-10-22T07:50:44","modified_gmt":"2014-10-22T14:50:44","slug":"problem-with-country-dropdown-in-add-event","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/","title":{"rendered":"Problem with Country dropdown in &#8216;Add Event&#8217;"},"content":{"rendered":"<p>Attempting to use jQuery to make a separate drop down menu disappear, depending on whether or not the user selects Canada or United States in the Country drop down menu.<\/p>\n<p>The province drop down (for canada) is wrapped in a div titled provincediv<\/p>\n<p>Code is below:<\/p>\n<p>$(&#8220;#provincediv&#8221;).show();<\/p>\n<p>\/\/Show the text field only when the third option is chosen &#8211; this doesn&#8217;t<br \/>\n$(&#8216;#EventCountry&#8217;).change(function() {<br \/>\nif ($(&#8220;#EventCountry&#8221;).val() == &#8220;1&#8221;) {<br \/>\n$(&#8220;#provincediv&#8221;).hide();<br \/>\n}<br \/>\nelse {<br \/>\n$(&#8220;#provincediv&#8221;).show();<br \/>\n}<br \/>\n});<\/p>\n<p>Unsure of what the value should be when trying to sync with the $countries array (in tribe-view-helpers.class.php) &#8212; Ive tried &#8220;United States&#8221;, I&#8217;ve tried &#8220;US&#8221;, and I&#8217;ve tried both &#8220;1&#8221; and &#8220;2&#8221; the number of lines it is down from the first array number. How can I properly connect this?<\/p>\n<p>Example: User clicks United States&#8230; the loadStates() is loaded as per usual, and the div provincediv is hidden. Is user clicks Canada, the provincediv is shown, and the loadStates() is hidden (as per usual)<\/p>\n<p>Thanks.<\/p>\n","protected":false},"template":"","class_list":["post-794660","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Problem with Country dropdown in &#039;Add Event&#039; -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Problem with Country dropdown in &#039;Add Event&#039; -\" \/>\n<meta property=\"og:description\" content=\"Attempting to use jQuery to make a separate drop down menu disappear, depending on whether or not the user selects Canada or United States in the Country drop down menu. The province drop down (for canada) is wrapped in a div titled provincediv Code is below: $(&#8220;#provincediv&#8221;).show(); \/\/Show the text field only when the third [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/\" \/>\n<meta property=\"article:modified_time\" content=\"2014-10-22T14:50:44+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/\",\"name\":\"Problem with Country dropdown in 'Add Event' -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2014-10-07T19:39:27+00:00\",\"dateModified\":\"2014-10-22T14:50:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Community Events\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Problem with Country dropdown in &#8216;Add Event&#8217;\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Problem with Country dropdown in 'Add Event' -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/","og_locale":"en_US","og_type":"article","og_title":"Problem with Country dropdown in 'Add Event' -","og_description":"Attempting to use jQuery to make a separate drop down menu disappear, depending on whether or not the user selects Canada or United States in the Country drop down menu. The province drop down (for canada) is wrapped in a div titled provincediv Code is below: $(&#8220;#provincediv&#8221;).show(); \/\/Show the text field only when the third [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/","article_modified_time":"2014-10-22T14:50:44+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/","name":"Problem with Country dropdown in 'Add Event' -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2014-10-07T19:39:27+00:00","dateModified":"2014-10-22T14:50:44+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-country-dropdown-in-add-event\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Community Events","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/"},{"@type":"ListItem","position":5,"name":"Problem with Country dropdown in &#8216;Add Event&#8217;"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/794660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/794660\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=794660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}