title: Django , open modal form with value , using javascript
body: <p>I'm new at django and javascript  , I try to open modal with value of rowid  , I could pass value at last but can't open form with it here my code downbelow ;</p>
  
  <p><strong>inside HTML:</strong></p>
  
  <pre><code>&lt;thead&gt;
        {% for customer in object_list %}
        &lt;tr&gt;
          &lt;td&gt;{{ customer.id }}&lt;/td&gt;
          &lt;td&gt;{{ customer.name }}&lt;/td&gt;
          &lt;td&gt;{{ customer.surname }}&lt;/td&gt;
          &lt;td&gt;{{ customer.gender }}&lt;/td&gt;
          &lt;td&gt;{{ customer.email }}&lt;/td&gt;
          &lt;td&gt;{{ customer.phone }}&lt;/td&gt;
          &lt;td&gt;{{ customer.bloodtype }}&lt;/td&gt;
          &lt;td&gt;&lt;a href=# data-target="#my_modal" data-toggle="modal" class="identifyingClass" data-id="{{ customer.id }}"&gt;Open Modal&lt;/a&gt; &lt;/td&gt;
        &lt;/tr&gt;
        {% endfor %}
      &lt;/thead&gt;
  </code></pre>
  
  <p><strong>My Modal</strong></p>
  
  <pre><code>&lt;h2&gt;Modal&lt;/h2&gt;
  &lt;div class="modal fade" id="my_modal" tabindex="-1" role="dialog" aria-labelledby="my_modalLabel"&gt;
  &lt;div class="modal-dialog" role="dialog"&gt;
      &lt;div class="modal-content"&gt;
          &lt;div class="modal-header"&gt;
              &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
              &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal Title&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class="modal-body"&gt;
  
            &lt;form method="post"&gt;
              {% csrf_token %}
                {{ form.as_p }}
                &lt;input type="submit" value="Update"&gt;
            &lt;/form&gt;
  
              &lt;input type="hidden" name="hiddenValue" id="hiddenValue" value="{{ customer.id }} /&gt;
          &lt;/div&gt;
          &lt;div class="modal-footer"&gt;
              &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;No&lt;/button&gt;
              &lt;button type="button" class="btn btn-primary"&gt;Yes&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function () {
   $(".identifyingClass").click(function () {
       var my_id_value = $(this).data('id');
       $(".modal-body #hiddenValue").val(my_id_value);
   })
  });
  &lt;/script&gt;
  </code></pre>