-2
How can I do a function in javascript that changes the total_productions field every time a field changes its value in the form?
I have the following code
Template
<form class="form" role="form" method="POST" >
<table class="table table-condensed table-responsive">
<thead>
<tr>
<th>Produção Científica nos últimos 3 anos</th><th>Quantidade</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ form.pc_artigos_qualis_a1_cinco_autores.label }}
<td>{{ form.pc_artigos_qualis_a1_cinco_autores }}</td>
</tr>
<tr>
<td>{{ form.pc_artigos_qualis_a1_mais_cinco_autores_primeiro_ultimo.label }}</td>
<td>{{ form.pc_artigos_qualis_a1_mais_cinco_autores_primeiro_ultimo }}</td>
</tr>
<tr>
<td>{{ form.total_producoes.label }}</td>
<td>{{ form.total_producoes }}</td>
</tr>
</tbody>
</table>
</form>
I’m still learning to code in python Django, so I’m open to criticism of the code!
I didn’t understand and only with this information is difficult to help? Updates what?
– novic
then, in the code I have the "form.pc_artigos_qualis_a1_cinco_authors" and the "form.pc_artigos_qualis_a1_mais_cinco_autores_primeiro_ultimo", these two fields are of the whole type, and what I want to do is update the form.total_producoes field when one of them changes its value
– Pierre Fenner
They are text inputs???
– novic
yes yes, they are text
– Pierre Fenner
You made some javascript?
– novic
no, I was just researching and testing on my code but I wasn’t getting
– Pierre Fenner