Change a field on change another field using django-autocomplete-light
<p>Basically I want to change value of company id and company name if your company field is changed. 
<a href="https://i.stack.imgur.com/jGd03.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jGd03.png" alt="img"></a>
Here I have used <a href="https://github.com/yourlabs/django-autocomplete-light" rel="nofollow noreferrer">django-autocomplete-light</a> for your company field. Code for this form:</p>

<pre><code>class PartnerAddForm(forms.ModelForm):
company_id = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control', 'disabled': ''}), required=False)
company_name = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control', 'disabled': ''}), required=False)


class Meta:
    model = CompanyCompanyMap
    fields = ('your_company',)
    widgets = {
        'your_company': autocomplete.ModelSelect2(url='url_company_autocomplete',
                                                  attrs={'class': 'form-control',
                                                         'data-placeholder': 'Type for getting available companies'})
    }
</code></pre>

<p>Code for autocomplete view of your company field:</p>

<pre><code>class CompanyAutocomplete(autocomplete.Select2QuerySetView):
def get_queryset(self):
    qs = CompanyAccess(self.request).get_non_partners()
    if self.q:
        qs = qs.filter(company_name__istartswith=self.q)
    return qs
</code></pre>

<p>And code for template of this form</p>

<pre><code>&lt;form class="form-horizontal" role="form" action="." method="POST"&gt;
            {% csrf_token %}

            {% for f in form %}
                &lt;div class="form-group"&gt;
                &lt;label for="id_{{ f.name }}" class="col-sm-2 control-label"&gt;{{ f.label|capfirst }}&lt;/label&gt;
                &lt;div class="col-sm-7"&gt;
                    {{ f }}
                &lt;/div&gt;
            &lt;/div&gt;
            {% endfor %}


            &lt;div class="form-group"&gt;
                &lt;label class="col-sm-2 control-label"&gt;&lt;/label&gt;
                &lt;div class="col-sm-7"&gt;
                    &lt;button type="submit" class="btn btn-default btn-primary"&gt;
                        Add Company as Friend
                    &lt;/button&gt;
                &lt;/div&gt;
            &lt;/div&gt;

            &lt;!-- /.table-responsive --&gt;
        &lt;/form&gt;
</code></pre>

<p>Is there any way to change it using js or other mechanism?</p>