3

I have a jquery script to show modal form

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>


<script>
$(document).ready(function(){
    $(".manipulate").click(function(){
        $('#id_description').val();
        var item_keys = ['#id_counter', '#id_first_name','#id_middle_name', '#id_last_name', '#id_display_name', '#id_field', '#id_loa_price', '#id_basic_cert_price', '#id_written_appraisal_cost']
        for(var i=1; i<12; i++){
            var item_val = $(this).parent().parent().find('td:nth-child('+i+')')[0].innerText;
            console.log("InnerText is :"+ item_val);
            $(item_keys[i-1]).val(item_val);
        }
        $('#id_item').val($(this).attr('item_id'));
        $('#edititemModal').modal("show");
    });
});
</script>

If i click the edit button to show the modal form i get .modal not a function.

rrk
  • 15,677
  • 4
  • 29
  • 45
uche
  • 85
  • 2
  • 2
  • 14
  • 3
    If you add the mark up, it will be very useful. – rrk May 26 '16 at 14:50
  • Works fine here: http://jsfiddle.net/jn81w7ym/1/, make sure you are including bootstrap correctly. – Adam Konieska May 26 '16 at 15:04
  • Possible duplicate of [Bootstrap modal: is not a function](https://stackoverflow.com/questions/25757968/bootstrap-modal-is-not-a-function) – Anph Sep 11 '17 at 07:44

2 Answers2

4
<script type="text/javascript">

not

<script>

Also follow the right order: Bootstrap modal: is not a function

Community
  • 1
  • 1
Destrif
  • 2,104
  • 1
  • 14
  • 22
  • 1
    As of HTML 5, the `type` attribute is (a) optional (b) explicitly advised against using for script elements containing JavaScript. – Quentin Apr 09 '19 at 09:12
-2

I resolved it after adding the library inside the index.js.We think you need this liabrary,bootstrap.js please add inside the index.js and i hope your code works will fine.