注册页面学校显示方式修改为文本框

This commit is contained in:
Wen 2014-04-23 11:10:11 +08:00
parent f8c6d7d77e
commit 735f920e9d
1 changed files with 13 additions and 4 deletions

View File

@ -109,14 +109,21 @@
<p style="width:357px;padding-left: 26px;">
<% unless User.current.user_extensions.school_id.nil? %>
<% unless User.current.user_extensions.school.nil? %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span><%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province, User.current.user_extensions.school.province), :onchange => "get_options(this.value)" %>
<input id="occupation" name="occupation" type="hidden" value="<%=User.current.user_extensions.school.id%>" />
<input id="occupation_name" type="text" value="<%=User.current.user_extensions.school.name%>" readonly />
<%= select_tag "occupation", options_for_select([[User.current.user_extensions.school.name, User.current.user_extensions.school.id]]) %>
<!--<%= select_tag "occupation",
options_for_select([[User.current.user_extensions.school.name, User.current.user_extensions.school.id]]) %>-->
<% else %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span><%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onchange => "get_options(this.value)" %>
<%= select_tag "occupation" %>
<input id="occupation" name="occupation" type="hidden" />
<input id="occupation_name" type="text" readonly />
<% end %>
<!-- <input id="occupation" readonly />-->
</p>
@ -133,7 +140,9 @@
</div>
<script type="text/javascript">
function test(id, name){
$("#occupation").html("<option value='"+id+"'>"+name+"</option>");
//$("#occupation").html("<option value='"+id+"'>"+name+"</option>");
$("#occupation").val(id);
$("#occupation_name").val(name);
$("#lean_overlay").hide();
$("#OpenWindow").hide();
}