点击打开编辑资料,显示保存的性别

guange_homework
cxt 10 years ago
parent 50aa22c5e5
commit 5f0aac9265

@ -213,6 +213,7 @@
<% occupation1 = User.current.user_extensions.occupation %> <% occupation1 = User.current.user_extensions.occupation %>
<% occupation = User.current.user_extensions.occupation %> <% occupation = User.current.user_extensions.occupation %>
<% title = User.current.user_extensions.technical_title %> <% title = User.current.user_extensions.technical_title %>
<% gender = User.current.user_extensions.gender %>
<% language = User.current.language %> <% language = User.current.language %>
<% else %> <% else %>
<% province = "湖南省" %> <% province = "湖南省" %>
@ -510,6 +511,13 @@
} }
} }
} }
function init_gender(pField, gender) {
for (var i=0; i<pField.options.length; i++) {
if (pField.options[i].value == gender) {
pField.selectedIndex = i;
}
}
}
$(function(){ $(function(){
//学校 //学校
$("#province").attr("href", "#WOpenWindow") $("#province").attr("href", "#WOpenWindow")
@ -527,6 +535,10 @@
var occupation1 = "<%= "#{occupation}" %>" var occupation1 = "<%= "#{occupation}" %>"
init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title, language); init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title, language);
//sex
var gender = "<%= "#{gender}" %>"
init_gender(document.getElementById('gender'), gender);
$("#userIdentity").change(); $("#userIdentity").change();
<% if( !@act.nil? && @act == 'password') %> <% if( !@act.nil? && @act == 'password') %>
$("#users_tb_2").click(); $("#users_tb_2").click();

Loading…
Cancel
Save