Friday, June 24, 2011

Script to verify if a date is valid or not


<script type="text/javascript">
function isValidDate(s) {
// format D(D)/M(M)/(YY)YY
var dateFormat = /^\d{1,4}[\.|\/|-]\d{1,2}[\.|\/|-]\d{1,4}$/;
if (dateFormat.test(s)) {

s = s.replace(/0*(\d*)/gi,"$1");
var dateArray = s.split(/[\.|\/|-]/);
// correct month value
dateArray[1] = dateArray[1]-1;
// correct year value
if (dateArray[2].length<4) {
// correct year value
dateArray[2] = (parseInt(dateArray[2]) < 50) ? 2000 + parseInt(dateArray[2]) : 1900 + parseInt(dateArray[2]);
}
var testDate = new Date(dateArray[2], dateArray[1], dateArray[0]);
if (testDate.getDate()!=dateArray[0] || testDate.getMonth()!=dateArray[1] || testDate.getFullYear()!=dateArray[2]) {
                    alert("enter correct date");
return false;
} else {
                     alert("correct date");
return true;
                     
}
} else {
return false;
}
}
   

    </script>

Hide Query By Example of PanelCollection on page load

Hi All, If there is a table with filterable is true. If you want to display QueryByExample then surround this table with panelCollection....