(function() { $("#CalenderListDrop option:selected").text(displayfreeTimeonLoad()); } );
$(document).ready(function () { var getListCalender = document.getElementById('CalenderListDrop'); spHostUrl = decodeURIComponent(getQueryStringParameter('SPHostUrl')); context = new SP.ClientContext.get_current(); parentContext = new SP.AppContextSite(context, spHostUrl); web = parentContext.get_web(); var allLists = web.get_lists(); context.load(allLists); context.executeQueryAsync( function () { var listEnumerator = allLists.getEnumerator(); while (listEnumerator.moveNext()) { var listName = listEnumerator.get_current(); var listTypeId = listName.get_baseTemplate(); if (listTypeId == SP.ListTemplateType.events) { var array = new Array(listName.get_title()); for (var i = 0; i < array.length; i++) { var opt = document.createElement("option"); getListCalender.options.add(opt); opt.text = array[i]; opt.value = array[i]; } } break; } } ), function () { alert("Eror"); }; } );
<select id="CalenderListDrop"> </select>
<select id="LedigTiderDrop"> </select>
$(document).ready(function() { $('#CalenderListDrop').on('change', function() { //do something... $("#CalenderListDrop option:selected").text(displayfreeTimeonLoad()); }); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)