I have an HTML form that a user can add an arbitrary amount of input fields to through jQuery. The user is also able to remove any input field from any position. My current implementation is that each new input box has an id of "field[i]" so when the form is posted it is processed in Python as field1, field2 field3, ...field[n]
i = 0
while self.request.get("field" + str(i)):
temp = self.request.get("field" + str(i))
someList.append(temp)
i += 1
(Assume the JavaScript handles removing of deleted elements and sorts the field names prior to post for simplicity)
This approach is working for me, but is there a better way to handle this situation? I feel like this is a very brute force method.
Platform information: Python 2.5.4; JavaScript; DHTML; jquery; Google App Engine
Edit: It appears that self.request.get_all() was the solution: GAE Doc