I have a web page where I need to create a number of fields and variables dynamically.
Let me explain : On page One, I have a text field where i have to type the number of users I want. That number is passed as parameter to the next page (post method) and collected as nb_user on page Two.
In the template.xml of page Two i have this code :
<form method="POST" class="col-md-8" action="/page_three">
<t t-foreach="nb_user" t-as="user">
<input type="text" name="comp_1_user_1" id="comp_1_user_1" class="form-control" placeholder="Computer user"/>
</t>
<input type="submit" class="btn btn-primary" value="Validate"/>
What I would like is that based on the number that is passed in post (nb_user), it should dynamically create that amount of text fields ans also create unique id (comp_1_user_1, comp_1_user_2 etc....) so that i can enter that data into my database.
So if the parameter was 3 then it should create 3 text fields and create 3 variables comp_1_user_1, comp_1_user_2, comp_1_user_3.
I hope I was clear enough . I am very new to Odoo and Qweb.
Thanks for any help you can provide.