function EntryVoteData() { if(VerificationData()==true){ var Name=$("div[id$='_txt_Name_upLevelDiv']").text(); var peoplePickerData = getPeoplePickerDataDocument(); var userId = getXmlValue(peoplePickerData, "/ArrayOfDictionaryEntry/DictionaryEntry[./Key = 'SPUserID']/Value"); var Part=$("#txt_Part").val(); var Tel=$("#txt_Tel").val(); var Other=$("#txt_Other").val(); var ActivityID=$("#td_IDInfo").text(); try { var context = new SP.ClientContext.get_current(); var web = context.get_web(); var list = web.get_lists().getByTitle($("#div_TeamActivityLibName").text()); var listItemCreationInfo = new SP.ListItemCreationInformation(); var newItem = list.addItem(listItemCreationInfo); // var newLookupField = new SP.FieldLookupValue(); // newLookupField.set_lookupId(ActivityID) newItem.set_item('Title', Name+"111"); newItem.set_item('_x56e2__x961f___ID', ActivityID); newItem.set_item('_x5907__x6ce8__x4_', Other); newItem.set_item('_x62a5__x540d___', parseInt(userId) ); newItem.set_item('_x62a5__x540d__x4eb0e8__x95', Part); newItem.set_item('_x8054__x8bdd_', Tel); newItem.update(); context.executeQueryAsync(Function.createDelegate(this, this.addVotesuccess), Function.createDelegate(this, this.addVotefailed)); } catch (e) { alert('失败:'+e.Message); } } } function addVotesuccess() { alert('成功!');$("div[id$='div_Count']").text('1'); ClearData();} function addVotefailed(sender, args) {alert('失败 消息:' + args.get_message());}