title: Django- Display calculated value in a form from other form fields
body: <p>I am a beginner in Django and I have this scenario: a customer wants to know the equivalent of a sum in his local currency. </p>
  
  <p>He fills a form (<code>ModelForm</code>) where he indicates the amount and the country and the program calculates the equivalent amount in local currency.</p>
  
  <p>After filling the country and amount fields in the form, the new amount is correctly calculated and saved in the database, but the equivalent_amount field doesn't change in the form displayed.</p>
  
  <p>My question is: </p>
  
  <p>How can I update the view of the form so when the user inserts the amount and the country, the <code>new_amount</code> field is displayed automatically with its calculated value ? should I integrate a JavaScript code in it? If so, how?</p>
  
  <p>Here is my views.py</p>
  
  <pre><code>from django.shortcuts import render
  from .forms import  ConversionForm
  from .calculate_amount import calculate
  
  def convert(request):
  if request.method == "POST":
      form = ConversionForm(request.POST)
  else:
      form = ConversionForm()
  if form.is_valid():
      conversion = form.save(commit=False)
      conversion.local_amount=calculate(conversion.initial_amount,conversion.country)
      conversion.save()
  
  return render(request, 'convertamount/convertform.html', {'form': form})
  </code></pre>
  
  <p>And here is my convertform.html</p>
  
  <pre><code>&lt;h1&gt;Conversion form&lt;/h1&gt;
  &lt;form method="POST" class="post-form"&gt;{% csrf_token %}
        {{ form.as_p }}
        &lt;button type="submit" class="save btn btn-default"&gt;Save&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Thanks in advance</p>