I'm working with a pre made theme using TPL and PHP. The original coder used: "Male" "Female" & "Other" as his three sources of gender.
Everytime I try add "Trans Male" or "Trans Female" to the values, it says "Please pick a valid gender" when selecting Trans, even though I have added them into my database under the "User_Gender". I'm guessing you cannot use {If} as it exceeds three options?
I can't work out how I correctly code them into the {If} sequence or would I need to re-write the code to display and store the gender?
This is the code (for picking the gender on registration) (Also having problems when selecting it on registration too):
<div class="form-group">
<label for="gender">{__("I am")}</label>
<select name="gender" id="gender" class="form-control" required>
<option value="none">{__("Select Sex")}:</option>
<option {if $user_profile->gender == "male"}selected{/if} value="male">{__("Male")}</option>
<option {if $user_profile->gender == "female"}selected{/if} value="female">{__("Female")}</option>
<option value="other">{__("Other")}</option>
</select>
</div>
I turned the code too:
<div class="form-group">
<label for="gender">{__("I am")}</label>
<select name="gender" id="gender" class="form-control" required>
<option value="none">{__("Select Sex")}:</option>
<option {if $user_profile->gender == "male"}selected{/if} value="male">{__("Male")}</option>
<option {if $user_profile->gender == "female"}selected{/if} value="female">{__("Female")}</option>
<option {if $user_profile->gender == "transmale"}selected{/if} value="transmale">{__("Trans Male")}</option>
<option {if $user_profile->gender == "transfmale"}selected{/if} value="transfmale">{__("Trans Female")}</option>
<option value="other">{__("Other")}</option>
</select>
</div>
"Please select valid gender" when I test the sign up. The Database values are: "user_gender" "ENUM" "Values:'male','female','transmale','transfmale','other'"
Also does this when trying to pull the info from the database to store onto the user profile with fa fa icons. I adapted the code to match the output:
<li>
<div class="about-list-item">
{if $profile['user_gender'] == "male"}
<i class="fa fa-male fa-fw fa-lg"></i>
{__("Male")}
{elseif $profile['user_gender'] == "female"}
<i class="fa fa-female fa-fw fa-lg"></i>
{__("Female")}
{else}
<i class="fa fa-user fa-fw fa-lg"></i>
{__("Other")}
{/if}
</div>
</li>
Them three work fine. But, when I add trans into the equation it doesn't. Even if I place the trans options after the {else}
tagged with other. Still gives me the please select valid gender.
Where am I going wrong? Or is the {if}
string not suitable for this?