I’ve created a custom field and I’m using conditionals to match the value of that custom field. However one of the options contains an apostrophe (single quote) in the string. As a result of this it isn’t matching correctly. Here’s my code:
<select name="order_custom2" id="order_custom2" class="select" tabindex="2" >
<option value="Option One"{if order_custom2 == "Option One"} selected="selected" {/if}>Option One</option>
<option value="Option Two" {if order_custom2 == "Option Two"}selected="selected"{/if}>Option Two</option>
<option value="I'm Option Three" {if order_custom2 == "I'm Option Three"}selected="selected"{/if}>I'm Option Three</option>
</select>Option One and Two match when when {order_custom2} is equal to either of those. Option Three never matches however even though if I just output {order_custom2} when it’s very is that of the third option it outputs
I’m Option Three
An exact match.
I know in the documentation for conditionals that it makes mention of special characters but the apostrophe is not listed in the conversion list. I’ve also tried replacing the apostrophe with it’s HTML character entity code but there’s still no difference. When I test taking the apostrophe out it matches fine so it’s definitely something to do with that apostrophe but I just don’t know how to get it to match. I’ve tried HTML character entities and escaping with a backslash but neither have worked.