<option value="transfeminine">Transfeminine</option>␊ |
<option value="transmasculine">Transmasculine</option>␊ |
<option value="trigenderpyrofox">Tri-gender pyrofox (from the forest planet)</option>␊ |
␊ |
</select>␊ |
</div>␊ |
<div class="form-group">␊ |
<label>Or enter a custom gender:</label>␊ |
<input type="text" id="customGender"> <button id="genderAdd" type="button" class="btn btn-primary">Set</button>␊ |
</div>␊ |
<nav>␊ |
<ul class="pager">␊ |
<li><a href="./main/info/1">Prev</a></li>␊ |
|
$("#gender").on("change", function () {␊ |
$.post("./main/sessionset/gender/", {"gender": $(this).val()});␊ |
});␊ |
␊ |
␊ |
function addGender() {␊ |
var value = $("#customGender").val();␊ |
if (value) {␊ |
$("#gender").append($("<option/>", {␊ |
value: value.toLowerCase(),␊ |
text: value.toLowerCase(),␊ |
selected: "selected"␊ |
}));␊ |
␊ |
$("#gender").val(value).change();␊ |
$("#customGender").val("");␊ |
}␊ |
}␊ |
␊ |
$("#customGender").keyup(function (e) {␊ |
if (e.which == $.ui.keyCode.ENTER) {␊ |
addGender();␊ |
}␊ |
});␊ |
␊ |
$("#genderAdd").click(function () {␊ |
addGender();␊ |
});␊ |
});␊ |
</script>␊ |
␊ |