{"id":794340,"date":"2014-10-07T09:24:08","date_gmt":"2014-10-07T16:24:08","guid":{"rendered":"https:\/\/tri.be\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/"},"modified":"2014-10-07T12:11:37","modified_gmt":"2014-10-07T19:11:37","slug":"question-regarding-countries-array-in-tribe-view-helpers-class-php","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/","title":{"rendered":"Question regarding: $countries array in tribe-view-helpers class.php"},"content":{"rendered":"<p>Hello,<\/p>\n<p>I am working on a customization and would like some information on how the $countries variable logs the value of the select dropdown in the front end.<\/p>\n<p>Basically, I am trying to use jQuery to either hide or show an element on the Add Events page &#8211; based on the value of the country selected in the Country dropdown&#8230;<\/p>\n<p>The code I am using here: <\/p>\n<p>&lt;script&gt;\t\t\t\t\t  $(&#8216;select[name=venue[Country]]&#8217;).change(function () {<br \/>\nif ($(this).val() == &#8216;Canada&#8217;) {\t\t\t\t$(&#8216;#StateProvinceSelectCAN&#8217;).show();<br \/>\n} else {\t\t\t\t\t\t\t$(&#8216;#StateProvinceSelectCAN&#8217;).hide();<br \/>\n}<br \/>\n});<br \/>\n&lt;\/script&gt;<\/p>\n<p>However, this script is not working. I was wondering what the proper value structure is for the $countries array, is it<br \/>\n[0] &#8211; starting at &#8220;Select a country:&#8221;<br \/>\n[1] &#8211; &#8220;United States&#8221;<br \/>\n[2] &#8211; &#8220;Afghanistan&#8221; &#8230;. etc<\/p>\n<p>Or are the values the:<br \/>\n&#8220;US&#8221;<br \/>\n&#8220;AF&#8221;<br \/>\n&#8220;AL&#8221;<br \/>\nI have tried to manually count out the numerical value for &#8216;Canada&#8217; in the list which is 39 or 40, and tried this method to no success &#8211; Ive also tried &#8220;Canada&#8221; as the value in my jQuery script &#8211; with no success either.<\/p>\n<p>Any help on this issue would be greatly appreciated.<\/p>\n<p>Thanks<\/p>\n","protected":false},"template":"","class_list":["post-794340","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>Question regarding: $countries array in tribe-view-helpers class.php -<\/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\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Question regarding: $countries array in tribe-view-helpers class.php -\" \/>\n<meta property=\"og:description\" content=\"Hello, I am working on a customization and would like some information on how the $countries variable logs the value of the select dropdown in the front end. Basically, I am trying to use jQuery to either hide or show an element on the Add Events page &#8211; based on the value of the country [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/\" \/>\n<meta property=\"article:modified_time\" content=\"2014-10-07T19:11:37+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\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/\",\"name\":\"Question regarding: $countries array in tribe-view-helpers class.php -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2014-10-07T16:24:08+00:00\",\"dateModified\":\"2014-10-07T19:11:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/#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\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Question regarding: $countries array in tribe-view-helpers class.php\"}]},{\"@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":"Question regarding: $countries array in tribe-view-helpers class.php -","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\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/","og_locale":"en_US","og_type":"article","og_title":"Question regarding: $countries array in tribe-view-helpers class.php -","og_description":"Hello, I am working on a customization and would like some information on how the $countries variable logs the value of the select dropdown in the front end. Basically, I am trying to use jQuery to either hide or show an element on the Add Events page &#8211; based on the value of the country [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/","article_modified_time":"2014-10-07T19:11:37+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\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/","name":"Question regarding: $countries array in tribe-view-helpers class.php -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2014-10-07T16:24:08+00:00","dateModified":"2014-10-07T19:11:37+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/question-regarding-countries-array-in-tribe-view-helpers-class-php\/#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":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Question regarding: $countries array in tribe-view-helpers class.php"}]},{"@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\/794340","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\/794340\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=794340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}