Dynamic form with Javascript in Django project

Thank you for your answer.
Well, it’s a task I’ve already done outside of Django and it worked very well. Also my code here is mainly a copy-paste of a validated response in a forum.
As Django has a particular template management system, linked to urls and views, I wondered if there was a conflict between Javascript and Django.

But I’m glad that’s not the case. Do you see an error in my code that could explain my problem?