Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. var soapEnv =
  4. "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
  5. <soapenv:Body>
  6. <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>
  7. <listName>Posts</listName>
  8. <viewName>{B9212691-1AF1-41AF-9DA7-6073ADDB091B}</viewName>
  9. <View>
  10. <Query>
  11. <OrderBy>
  12. <FieldRef Name='ID' Ascending='False' />
  13. </OrderBy>
  14. </Query>
  15. <RowLimit>1</RowLimit>
  16. </View>
  17. </GetListItems>
  18. </soapenv:Body>
  19. </soapenv:Envelope>";
  20.  
  21. $.ajax({
  22. url: "_vti_bin/lists.asmx",
  23. type: "POST",
  24. dataType: "xml",
  25. data: soapEnv,
  26. complete: processResult,
  27. contentType: "text/xml; charset="utf-8""
  28. });
  29. });
  30.  
  31.  
  32. function processResult(xData, status) {
  33. $(xData.responseXML).find("z\:row").each(function() {
  34. var liHtml = "<li>" + $(this).attr("ows_ID") + "</li>";
  35. $("#tasksUL").append(liHtml);
  36. });
  37. }
  38.  
  39.  
  40. </script>
  41.  
  42. <ul id="tasksUL"/>
  43.  
  44. $(xData.responseXML).find("[nodeName='z:row']").each(function()
  45.  
  46. $(document).ready(function() {
  47.  
  48. var idquery="";
  49. $().SPServices({
  50. operation: "GetListItems",
  51. async: false,
  52. listName: "test",
  53. CAMLQuery: idquery,
  54. CAMLRowLimit: 1,
  55. completefunc: function (xData, Status)
  56. {
  57. $(xData.responseXML).SPFilterNode("z:row").each(function() { //alert($(this).attr("ows_Title"));
  58. var getvalue= parseInt($(this).attr("ows_Title"))+1;//Auto increment value $("input[title='TicketNumber']").val(getvalue);
  59.  
  60. });
  61. }
  62. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement