title: Run script when select from selectpicker
body: <p>Please help me. I have a form, which has the class <code>selectpicker</code>.
  I need to run the JS every time when a user selects any value in <code>.selectpicker</code>. Is that possible? Is there any method?</p>
  
  <p>I have the following script for on load:</p>
  
  <pre><code>  $(window).on('load', function () {
  
      $('.selectpicker').selectpicker({
        'selectedText': 'cat'
      });
  
    // $('.selectpicker').selectpicker('hide');
    });
  </code></pre>
  
  <p>But I also need to do this with the select value in the form <code>.selectpicker</code>.</p>
  
  <pre><code>        &lt;div class="field field-manufacture"&gt;
            &lt;label&gt;Výrobce&lt;/label&gt;
            &lt;select n:name=manufacturer class="selectpicker" data-style="btn"&gt;
            &lt;/select&gt;
          &lt;/div&gt;&lt;!-- /.field --&gt;
  
          &lt;div n:snippet=searchSnippet class="field field-model"&gt;
            &lt;label&gt;Model&lt;/label&gt;
            &lt;select n:name=model class="selectpicker" data-style="btn"&gt;
            &lt;/select&gt;
          &lt;/div&gt;&lt;!-- /.field --&gt;
  </code></pre>
  
  <p>Snippet is dependent on first manufacturer, so when I select from the first, the second selectpicker is reloading data from database and changing CSS styling - so I need to run the first script again.</p>
  
  <p>Version of jquery: 1.10.2</p>
  
  <p>Thank you!</p>
  
  <p>-- edit, added AJAX:</p>
  
  <pre><code>        &lt;script&gt;
             {include #jsCallback, input =&gt; manufacturer, link =&gt; firstChange}
          &lt;/script&gt;
  
  
          {define #jsCallback}
  
          $('#{$control["searchForm"][$input]-&gt;htmlId}').on('change', function() {
          $.nette.ajax({
              type: 'GET',
              url: '{link {$link}!}',
              data: {
                  'value': $(this).val(),
              }
          });
          });
  
          {/define}
  </code></pre>