How get the Html-Ajax post array value like below stucture in Django view.py?
How get the Html-Ajax post array value like below stucture in Django view.py?
I have this form:
<form id="form">
<input type="text" name="group_name">
<div id="dynamic_form">
<input type="text" name="members[0][name]">
<input type="text" name="members[0][date]">
<input type="text" name="members[1][name]">
<input type="text" name="members[1][date]">
<input type="text" name="members[2][name]">
<input type="text" name="members[2][date]">
</div>
I would like to get the Html-Ajax post array value like below stucture in dijango view.py?
Expected Output:
"group_name": "SomeGroup",
"members": [
"name": "Alice",
"date": "01/01/2015"
,
"name": "Bob",
"date": "02/01/2015"
,
"name": "Carol",
"date": "03/01/2015"
,
]
Yes I want form array based group the data
– Ragu Natarajan
Aug 30 at 14:38
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
So you want to get such JSON blob when you POST to the view?
– Willem Van Onsem
Aug 30 at 14:25