View difference between Paste ID: GHMibFnU and 7iGyYjRV
SHOW: | | - or go back to the newest paste.
1
<script type="text/javascript">
2
    $(document).ready(function(){
3
        $('#tes').on('click',function(){
4
5
          var id="";
6-
          var check=$('[name="check[]"]')
6+
          var check=$('[name="check[]"]');
7
// harusnya check =$(".checklist"); tp sy blum nyoba!!
8
    for (i = 0; i < check.length; i++){   
9-
   id += check[i].value + "";
9+
10
   id  = id+ check[i].val() + ","; //value
11
  }
12
    }
13
    if (id==""){ //jika tidak ada buah yg dipilih  
14
  alert("Silahkan pilih buah favoritmu !");
15
        check[0].focus();
16
        return false;
17
    }
18
    else{
19
20
         // alert("Buah favorit kamu : " + id);
21-
    type : "GET",
21+
22
    type : "POST", //lebih baik post
23-
    data :{id:id},
23+
24
    data :{id:id}, //harusnya akan muncul 2,3,4 gitu
25
    success: function(html){
26
    $('#show-data').html(html);
27
    $('#modal-tes').modal('show');
28
 
29
30
    }
31
32
  });
33
        
34
    }
35
   
36
        
37
           
38
        });
39
40
    });
41
</script>