浏览 2013 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-03-31
<%= f.select :come_from, CustomerOut::FROM, {:prompt => CustomerOut::FROM[0][1]}, :onchange => remote_function(:update => "time_now", :with => "'username='+$('customer_out[username]').value + '&come_from='+$('customer_out[come_from]').value", :url =>{:action => 'check_customer'}, :before => "$('search_customer').innerHTML = '搜索中...';", :complete => "$('search_customer').innerHTML = '';" ) %> <div id="time_now"></div> .rb def check_customer @customer_out = CustomerOut.find(:first, :conditions => ["username = ? and come_from = ?", params[:username], params[:come_from]]) if @customer_out @consignee = @customer_out.customer.consignees.find(:first) else @customer_out = CustomerOut.new @customer_out.username = params[:username].strip @customer_out.come_from = params[:come_from] end render :text => Time.new.to_s end (还不会对<input>更改) 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |