From 891fa65c160652b6b47064fc738fe2e13a571cca Mon Sep 17 00:00:00 2001 From: yanxd Date: Fri, 25 Apr 2014 15:21:28 +0800 Subject: [PATCH] =?UTF-8?q?jquery=20=E7=82=B9=E5=87=BB=E7=9C=81=E4=BB=BD?= =?UTF-8?q?=E5=87=BA=E5=AD=A6=E6=A0=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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)' %>