title: Insert a variable from JS to Django form input field
body: <p>I am writing a form that pays an employee's mileage between two cities.  I am using the Google Maps API to get the information.  I am running a script that yields a variable <code>drivingDistanceMiles</code>.  I would like to populate the field in my Django form <code>mileage</code>, which saves to a python variable <code>distance</code>.</p>
  
  <p>Here is a snippet of my form html:</p>
  
  <pre><code>&lt;form action="" method="post"&gt;&lt;% csrf_token %}
  {{  form.non_field_errors  }}
  &lt;div class="fieldWrapper"&gt;
      {{  form.distance.errors  }}
      &lt;label for="id_distance"&gt;Mileage claim:&lt;/label&gt;
      {{  form.distance  }}
  &lt;/div&gt;
  </code></pre>
  
  <p>There is a distance calculator on the page just above the entry.</p>
  
  <p>In my forms.py <code>distance = forms.CharField(max_length=20, required = False)</code>.  I made this a CharField instead of an IntField in case my employees (not the most computer savvy bunch) add the word 'miles' at the end.  </p>
  
  <p>THE QUESTION:  Is it possible to get the value of <code>drivingDistanceMiles</code> to auto-populate when the user enters their city info into the distance calculator?</p>