{"id":11150132,"date":"2019-01-30T18:21:48","date_gmt":"2019-01-30T18:21:48","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/posted-data-how-to-get-dropdown-value\/"},"modified":"2019-01-30T18:21:48","modified_gmt":"2019-01-30T18:21:48","slug":"posted-data-how-to-get-dropdown-value","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/posted-data-how-to-get-dropdown-value\/","title":{"rendered":"Posted Data: how to get dropdown value?"},"content":{"rendered":"<p>Hello everyone!<\/p>\n<p>Sorry if I have missed this somewhere in the documentation, I have an issue getting the dropdown value (not display text) in my custom function.  I am getting the posted form data as follows:<\/p>\n<pre><code>$submission = WPCF7_Submission::get_instance();\n$formData = $submission-&gt;get_posted_data();\n$countryCode = $formData[&quot;your-country&quot;];<\/code><\/pre>\n<p>&#8220;your-country&#8221; is a dropdown box with all the country names and their two letter ISO code, example:<br \/>\n<code>&lt;option value=&quot;JP&quot;&gt;Japan&lt;\/option&gt;<\/code><\/p>\n<p>$formData[&#8220;your-country&#8221;] returns me only the caption (&#8220;Japan&#8221;) but not the actual option value.  Is there any way to get the option value?<\/p>\n<p>Thank you so much!<\/p>\n","protected":false},"template":"","class_list":["post-11150132","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11150132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11150132\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=11150132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}