Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.2 kB
2
Indexable
Never
function getDataSemester() {
                var npm = $("#search_box_datatable").val();
                var select = document.getElementById('select_semester');
                var kodecalon = $("#kodecalon").val();
                $.ajax({
                    type: "GET",
                    url: "/Pembayaran/GetPembayaranByNPM?reftagihan=" + npm + "&kodecalon=" + kodecalon,
                    success: function (data) {
                        $("#select_semester").empty();
                       


                        var option = document.createElement("option");
                        option.text = "All Semester";
                        option.value = -1;
                        select.add(option);


                        for (var i = 0; i < data.data.length; i++) {
                            var option = document.createElement("option");
                            option.text = data.data[i].SEMESTER;
                            option.value = data.data[i].SEMESTER;
                            select.add(option);
                        }

                        $("#select_semester").val(-2);
                    }
                });
            }