I am trying to:
Create a custom field search dropdown using the following code:
[wpv-control-postmeta field="wpcf-referral-countries" type="select" url_param="wpv-wpcf-referral-countries" default_label="Select Country"]
Link to a page where the issue can be seen:
Site is in maintenace mode at the moment - I can give yo login details privately if necessary
I expected to see:
A dropdown with the available countries. The top item should be "Select Country" and this should be selected by default.
Instead, I got:
A dropdown with the available countries. The top item is "Select Country" as expected, but below it there is a blank entry which is selected by default.
I've checked through and all of the posts have content in the country field so the blank item isn't coming from a missing entry.
The image shows the output and the code below shows the generated code.
<select id="wpv_control_select_wpcf-referral-countries" name="wpv-wpcf-referral-countries" class="js-wpv-filter-trigger form-control">
<option checked="checked" value="">Select Country</option>
<option value="" selected="selected"></option>
<option value="IT">Italy</option>
<option value="JP">Japan</option>
<option value="KE">Kenya</option>
<option value="KR">Korea, Republic Of</option>
<option value="ZA">South Africa</option>
<option value="ES">Spain</option>
<option value="GB">United Kingdom</option
<option value="US">United States</option>
</select>
It looks like we have:
checked="checked" on the default label
selected-"selected" on the blank entry
I've just run a test of this on a couple of different sites and it seems to work as expected.
Thanks
Tim
Guys, forget this. Someone else had set up the fields and left a blank one at the top of each field set for some reason. What a waste of my life.