How to send multiple input field values with same name?

前端 未结 3 1253
执念已碎
执念已碎 2020-12-28 09:01

I have m2m field, lets say it have name \'relations\', so i want to allow user to send as many relations as he wants. I add new input to html with javascript with same name,

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-28 09:37

    this generate a list, you can manipulate in for

    request.POST.getlist('relations')
    

提交回复
热议问题