我有一個窗體。我試圖通過AJAX GET請求來驗證它。窗體序列化問題
所以我想發送GET請求數據中的字段值。
$('#uxMyForm').serialize();
它返回的東西難以辨認的問題。我之前使用過序列化。這完全是b。。
連載的返回值是
actionsign_upcontrollersitedataauthenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&customer%5BuxName%5D=&customer%5BuxEmail%5D=&customer%5BuxResidentialPhone%5D=&customer%5BuxMobilePhone%5D=&customer%5BuxDateOfBirth%5D=&customer%5BuxAddress%5D=&customer%5BuxResidentialStatus%5D=
我不知道怎麼用這個。
感謝
更新:
我的問題是我如何處理這樣的要求?喜歡這個?
puts params[:data][:customer][:uxName]
我的GET請求觸發看起來像這樣
$.get('/site/sign_up',{data : $('#uxMyForm').serialize() }, function(data){
alert(data);
});
以上的jQuery線產生的請求..在操作方法我這樣做
render :text => params
當我觀察是什麼發送到GET,在螢火蟲PARAMS
**data** authenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&direct_customer%5BuxName%5D=&direct_customer%5BuxEmail%5D=&direct_customer%5BuxResidentialPhone%5D=&direct_customer%5BuxMobilePhone%5D=&direct_customer%5BuxDateOfBirth%5D=&direct_customer%5BuxAddress%5D=&direct_customer%5BuxResidentialStatus%5D=
,我在警告打印則返回值
actionsign_upcontrollersitedataauthenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&direct_customer%5BuxName%5D=&direct_customer%5BuxEmail%5D=&direct_customer%5BuxResidentialPhone%5D=&direct_customer%5BuxMobilePhone%5D=&direct_customer%5BuxDateOfBirth%5D=&direct_customer%5BuxAddress%5D=&direct_customer%5BuxResidentialStatus%5D=
它格式化它在一個'名1 =值1&名2 = value2'格式...一樣在瀏覽器(GET請求)查詢字符串,這是你'.serialize想要什麼()',如果你發佈你的提交代碼,你會更容易看到你實際上在做什麼。 – 2010-05-28 11:43:00
已更新..請建議 – ZX12R 2010-05-28 12:29:07