$.ajax({ type: "get", url: "./script/php/getTypeList.php", dataType: "json", async: false, success: function(data) { $.each(data.equipmentName, function(index, value) { $("#typeSelect").append(""); }); }, error: function(data) { console.log('error getDataTable:' + data); } }); var $w1finish = $('#w1').find('ul.pager li.finish'); $w1finish.on('click', function (ev) { ev.preventDefault(); //alert("送出資料!"); }); $('#w1').bootstrapWizard({ tabClass: 'wizard-steps', nextSelector: 'ul.pager li.next', previousSelector: 'ul.pager li.previous', firstSelector: null, lastSelector: null, onNext: function (tab, navigation, index, newindex) { }, onTabClick: function (tab, navigation, index, newindex) { if (newindex == index + 1) { return this.onNext(tab, navigation, index, newindex); } else if (newindex > index + 1) { return false; } else { return true; } }, onTabChange: function (tab, navigation, index, newindex) { var totalTabs = navigation.find('li').size() - 1; $w1finish[newindex != totalTabs ? 'addClass' : 'removeClass']('hidden'); $('#w1').find(this.nextSelector)[newindex == totalTabs ? 'addClass' : 'removeClass']('hidden'); } }); $("#typeSelect").change(function() { type = $(this).val(); $.ajax({ type: "get", url: "./script/php/getTypeDetail.php", dataType: "json", data: { type: type }, async: false, success: function(data) { var table = JSON.parse(data.table); $("#w1-profile").empty(); $.each(data.columnName, function(index, value) { if (index % 4 == 0) { $("#w1-profile").append('
'); $("#w1-profile-group" + index).append('
'); if (index + 1 < data.columnName.length) $("#w1-profile-group" + index).append('
'); if (index + 2 < data.columnName.length) $("#w1-profile-group" + index).append('
'); if (index + 3 < data.columnName.length) $("#w1-profile-group" + index).append('
'); $("#w1-profile").append('
'); } }); }, error: function(data) { console.log('error getDataTable:' + data); } }); });