Sunday, August 10, 2014

Caml query example withMultiple Lines of Text sharepoint 2013

1) Multiple Lines of Text
2) Value Type - Text
<Query>
<Where>
<Contains>

<FieldRef Name=\'Title\'/>'

      '<Value Type=\'Text\'>Shekhar</Value>

</Contains>
</Where>
</Query>

Caml query example with Single line of text sharepoint 2013

1) Single line of text

Value Type - Text

<Query>
<Where>
<Eq>
<FieldRef Name=\'Title\'/>'
      '<Value Type=\'Text\'>Shekhar</Value>
</Eq>
</Where>

</Query>

Caml Query Operators Sharepoint 2013

Operators
Some list of operators used in SPQuery

  1. Eq--Equals
  2. Neq--Not equal
  3. Gt--Greater than
  4. Geq--Greater than or equal
  5. Lt--Lower than
  6. Leq--Lower than
  7. IsNull--Is null
  8. BeginsWith--Begins with
  9. Contains--Contains

Thursday, August 7, 2014

return in javascript function

<!DOCTYPE html>
<html>
<body>



<p id="demo"></p>

<script>
function myFunction(a, b) {
    return a * b;
}
document.getElementById("demo").innerHTML = myFunction(4, 3);
</script>

</body>
</html>
This example calls a function which performs a calculation, and returns the result:12

Wednesday, August 6, 2014

Jquery DatePicker example 2

<html lang="en">
<head>
<style >
div.ui-datepicker{
 font-size:11px;
}
</style>
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
  <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
  <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>

  <script>

  $(function() {
    $( "#fromdatepicker" ).datepicker();
    $( "#todatepicker" ).datepicker();
  });
$(function() {
$("#btnFilter").click(function() {
 var startDate = $("#fromdatepicker").datepicker("getDate");
 startDate  =  startDate.getFullYear()+"-"+(startDate.getMonth()+1)+"-"+startDate.getDate();

 var endDate = $("#todatepicker").datepicker("getDate");
 endDate  =  endDate.getFullYear()+"-"+(endDate.getMonth()+1)+"-"+endDate.getDate();

 alert(startDate +"-"+ endDate);
});
});
  </script>
</head>
<body>

<p>
From Date: <input type="text" id="fromdatepicker" style="font-size:11px"  />
To Date: <input type="text" id="todatepicker" style="font-size:11px"  /> &nbsp;&nbsp;&nbsp;
<input type="button" id="btnFilter" value="Generate Report">
</p>


</body>
</html>
jQuery UI Datepicker - Default functionality From Date: To Date:    

Datepicker example Jquery

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"></p>
</body>
</html>
jQuery UI Datepicker - Default functionality Date:

add elements to array in javascript

<!DOCTYPE html>
<html>
<body>

<p>Click the button to add a new element to the array.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
var fruits = [];
document.getElementById("demo").innerHTML = fruits;

function myFunction() {
    fruits.push("Kiwi","Shekhar");
    document.getElementById("demo").innerHTML = fruits;
}
</script>

</body>
</html>
Click the button to add a new element to the array.