diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 9bc4cb2b5..6efd76e15 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -5,6 +5,8 @@ function(){ $("#province_lean").attr("href", "#WOpenWindow") $("#province_lean").leanModal({top: 100, closeButton: ".modal_close"}); + $("#province option").attr("disabled", true); + $("#province option").click(function(){get_options(this.value);}); } ); @@ -19,11 +21,11 @@ url :'/school/get_options/'+encodeURIComponent(value), data :'text', success: function(data){ - - $("#schoollist").html(data); - - } + }, + complete: function() { + $("#province option").attr("disabled", true); + } } @@ -117,7 +119,7 @@ <% else %> - <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onchange => "get_options(this.value)" %> + <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), onclick: '$("#province option").attr("disabled", false)' %>