1
我已經選擇像下面的客戶端:如何在GAE端獲得所有具有多種選擇的選擇值?
<select multiple="multiple" id="reason" class="input-xlarge">
<option value="001">reason1</option>
<option value="002">reason2</option>
<option value="003">reason3</option>
<option value="004">reason4</option>
<option value="005">reason5</option>
</select>
的數據被髮送到服務器與下面的代碼:
var reason = $('#reason').val();
$.ajax({
data: {'reason': reason},
...
});
...
和服務器上我做的:
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
arguments = self.request.arguments()
for argument in arguments:
if self.request.get(argument):
self.response.out.write(argument+': '+self.request.get(argument)+'<br>')
結果即使選擇了幾個原因,我看到:
reason[]: 002
如何獲取所有選定的值?
Upd1。他們在請求的傳遞:
reason%5B%5D=001&reason%5B%5D=002&reason%5B%5D=003&reason%5B%5D=004