User talk:Rahul gaurkhede

// To adjust popup in center function PopupCenter(url, title, w, h) { // Fixes dual-screen position                      Most browsers      Firefox var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; var left = ((screen.width / 2) - (w / 2)) + dualScreenLeft; var top = ((screen.height / 2) - (h / 2)) + dualScreenTop; var newWindow = window.open(url, title, 'scrollbars=yes,resizable=1, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); // Puts focus on the newWindow if (window.focus) { newWindow.focus; } }

function isNormalInteger(str) { return /^\+?(0|[0-9]\d*)$/.test(str); }

function validateEmail(emailField) { var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; if (reg.test(emailField.value) == false) { return false; } }

function validateNPCIEmail(emailField) { var reg = /^([A-Za-z0-9_\-\.])+\@argsolutions\.org\.in$/; if (reg.test(emailField.value) == false) { return false; } }

// To Check Blank Field function CheckEmptyField(val) {

var fname = val.value.replace(/^\s+|\s+$/g, ''); if (fname.length == 0) return false; else return true; }

function fn_DateCompare(Date1, Date2, Dt1Name, Dt2Name) { var a = document.getElementById(Date1); var b = document.getElementById(Date2); var dt1 = a.value.replace(/^\s+|\s+$/g, ''); if (dt1.length == 0) { alert("Please select " + Dt1Name); a.focus; return false; }   var dt2 = b.value.replace(/^\s+|\s+$/g, ''); if (dt2.length == 0) { alert("Please select " + Dt2Name); b.focus; return false; }   var arr1 = a.value.split('-'); var d1 = arr1[0] + '-' + arr1[1] + '-' + arr1[2]; var arr2 = b.value.split('-'); var d2 = arr2[0] + '-' + arr2[1] + '-' + arr2[2];

function getMonthIdx(monthName) { var months = { 'Jan': 0, 'Feb': 1, 'Mar': 2, 'Apr': 3, 'May': 4, 'Jun': 5, 'Jul': 6, 'Aug': 7, 'Sep': 8, 'Oct': 9, 'Nov': 10, 'Dec': 11 };       return months[monthName]; }   var firstValue = d1.split('-'); var secondValue = d2.split('-'); var firstDate = new Date; var validdt1 = firstDate.setFullYear(firstValue[2], (monthIdx = getMonthIdx(firstValue[1])), firstValue[0]); var secondDate = new Date; var validdt2 = secondDate.setFullYear(secondValue[2], (monthIdx = getMonthIdx(secondValue[1])), secondValue[0]);

function EqualDt(dt1, dt2) { var minute = 1000 * 60; var hour = minute * 60; var day = hour * 24; date1 = new Date(dt1); date2 = new Date(dt2); var time1 = date1.getTime; var time2 = date2.getTime; var day1 = Math.round(time1 / day); var day2 = Math.round(time2 / day); if (day1 == day2) return true; }

if (!isNaN(validdt1) && !isNaN(validdt2)) { if (firstDate > secondDate) { alert("" + Dt2Name + " should be greater than " + Dt1Name + ""); b.focus; return false; }   }    else { if (isNaN(validdt1)) { alert("Invalid format of " + Dt1Name); a.value = ''; a.focus; return false; }       else if (isNaN(validdt2)) { alert("Invalid format of " + Dt2Name); b.value = ''; b.focus; return false; }   } }

function fn_DateFormat(Date1, Dt1Name) { var a = document.getElementById(Date1); var dt1 = a.value.replace(/^\s+|\s+$/g, ''); if (dt1.length == 0) { alert("Please select " + Dt1Name); return false; }

function getMonthIdx(monthName) { var months = { 'Jan': 0, 'Feb': 1, 'Mar': 2, 'Apr': 3, 'May': 4, 'Jun': 5, 'Jul': 6, 'Aug': 7, 'Sep': 8, 'Oct': 9, 'Nov': 10, 'Dec': 11 };       return months[monthName]; }   var firstValue = a.value.split('-'); var firstDate = new Date; var validdt1 = firstDate.setFullYear(firstValue[2], (monthIdx = getMonthIdx(firstValue[1])), firstValue[0]); if (!isNaN(validdt1)) {

}   else { if (isNaN(validdt1)) { alert("Invalid format of " + Dt1Name); a.value = ''; a.focus; return false; }   } }

//  To Check Duplicate Records for Master Entries -Start function UserExists { var txtUName = document.getElementById("ContentPlaceHolder1_txtUserName"); var imgloader = document.getElementById("imgloader"); document.getElementById("imgloader").style.display = 'none'; CreateXmlHttpObject; var postpara = "&opt=1&id1=" + txtUName.value; //alert(postpara) var _location = String(document.location); var requestUrl = _location + _location.indexOf('?') == -1 ? "&" : "?" + new Date.getTime;

if (XmlHttpObject) { XmlHttpObject.onreadystatechange = function { UserExistsResponse(XmlHttpObject) } XmlHttpObject.open("POST", requestUrl, true); XmlHttpObject.setRequestHeader("IsAjax", "true"); XmlHttpObject.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); XmlHttpObject.setRequestHeader('Content-length', postpara.length); XmlHttpObject.send(postpara); } }

function UserExistsResponse(XmlHttpObject) { //alert(XmlHttpObject.readyState + " " + XmlHttpObject.status) var txtUName = document.getElementById("ContentPlaceHolder1_txtUserName"); var imgloader = document.getElementById("imgloader"); document.getElementById("imgloader").style.display = ''; var div = document.getElementById("divresponse"); if (XmlHttpObject.readyState == 4) { if (XmlHttpObject.status == 200) { var dsRoot = XmlHttpObject.responseText; //alert(dsRoot) var local; if (navigator.appName != "Netscape") { div.innerHTML = dsRoot; local = div.innerHTML.substring(0, 1); }           else { var root = new Function("return " + dsRoot); local = root[0].UserCnt; }           if (local > 0) { document.getElementById("imgloader").style.display = 'none'; alert('User Name already Exists.'); txtUName.value = ''; txtUName.focus; return false; }           else document.getElementById("imgloader").style.display = 'none'; }       else { //           alert('Error: ' + XmlHttpObject.status); //           return false; }   }    else { //       alert("Server is not ready.."); //       return false; } }

function UserMobExists { var txtMob = document.getElementById("ContentPlaceHolder1_txtMobile"); document.getElementById("imgloadermob").style.display = 'none'; CreateXmlHttpObject; var postpara = "&opt=2&id1=" + txtMob.value; //alert(postpara) var _location = String(document.location); var requestUrl = _location + _location.indexOf('?') == -1 ? "&" : "?" + new Date.getTime;

if (XmlHttpObject) { XmlHttpObject.onreadystatechange = function { UserMobExistsResponse(XmlHttpObject) } XmlHttpObject.open("POST", requestUrl, true); XmlHttpObject.setRequestHeader("IsAjax", "true"); XmlHttpObject.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); XmlHttpObject.setRequestHeader('Content-length', postpara.length); XmlHttpObject.send(postpara); } }

function UserMobExistsResponse(XmlHttpObject) { //alert(XmlHttpObject.readyState + " " + XmlHttpObject.status) var txtMob = document.getElementById("ContentPlaceHolder1_txtMobile"); document.getElementById("imgloadermob").style.display = ''; var div = document.getElementById("divresponse"); if (XmlHttpObject.readyState == 4) { if (XmlHttpObject.status == 200) { var dsRoot = XmlHttpObject.responseText; //alert(dsRoot) var local; if (navigator.appName != "Netscape") { div.innerHTML = dsRoot; local = div.innerHTML.substring(0, 1); }           else { var root = new Function("return " + dsRoot); local = root[0].MobCnt; }           if (local > 0) { document.getElementById("imgloadermob").style.display = 'none'; alert('MOBILE NO. already Exists.'); txtMob.value = ''; txtMob.focus; return false; }           else document.getElementById("imgloadermob").style.display = 'none'; }       else { //           alert('Error: ' + XmlHttpObject.status); //           return false; }   }    else { //       alert("Server is not ready.."); //       return false; } } //  To Check Duplicate Records for Master Entries -End

// To Clear all fields in  Master Entries page function ClearCtrl(opt) { var btnSave = document.getElementById("ContentPlaceHolder1_btnSave"); var txtName = document.getElementById("ContentPlaceHolder1_txtName"); var txtDesc = document.getElementById("ContentPlaceHolder1_txtDesc"); var chkActive = document.getElementById("ContentPlaceHolder1_chkActive"); var lbl = document.getElementById("ContentPlaceHolder1_lblmsg"); if (btnSave.value == 'ADD') txtName.value = ""; txtDesc.value = ""; if (opt == 'Clear') lbl.innerHTML = ""; chkActive.checked = false; }

function ValInactive { var btnSave = document.getElementById("ContentPlaceHolder1_btnSave"); var txtName = document.getElementById("ContentPlaceHolder1_txtName"); var txtDesc = document.getElementById("ContentPlaceHolder1_txtDesc"); var chkActive = document.getElementById("ContentPlaceHolder1_chkActive"); if (chkActive.checked == false) { txtName.disabled = true; txtDesc.disabled = true; return false; } }

function chkbxValInactive {

var btnSave = document.getElementById("ContentPlaceHolder1_btnSave"); var txtName = document.getElementById("ContentPlaceHolder1_txtName"); var txtDesc = document.getElementById("ContentPlaceHolder1_txtDesc"); var chkActive = document.getElementById("ContentPlaceHolder1_chkActive"); if (btnSave.value == 'Update') { if (chkActive.checked == true) { txtName.disabled = false; txtDesc.disabled = false; return true; }   } }

// To Validate Master Entries Page function Validate { var btnSave = document.getElementById("ContentPlaceHolder1_btnSave"); var txtName = document.getElementById("ContentPlaceHolder1_txtName"); var lblName = document.getElementById("ContentPlaceHolder1_lblName"); var txtDesc = document.getElementById("ContentPlaceHolder1_txtDesc"); var lblDesc = document.getElementById("ContentPlaceHolder1_lblDesc"); var chkActive = document.getElementById("ContentPlaceHolder1_chkActive"); var lblnm = lblName.innerHTML.replace(':', ''); var lbldc = lblDesc.innerHTML.replace(':', ''); var tname = txtName.value.replace(/^\s+|\s+$/g, ''); if (tname.length == 0) { alert("Please Enter " + lblnm.toUpperCase); txtName.focus; return false; }   if (tname.length > 50) { alert(lblnm.toUpperCase + " length allowed upto 50 characters."); txtName.focus; return false; }

var tdesc = txtDesc.value.replace(/^\s+|\s+$/g, ''); if (tdesc.length == 0) { alert("Please Enter " + lbldc.toUpperCase); txtDesc.focus; return false; }

if (tdesc.length > 50) { alert(lbldc.toUpperCase + " length allowed upto 50 characters."); txtDesc.focus; return false; }

if (btnSave.value == 'ADD') { if (chkActive.checked == false) { alert("Please select IsACTIVE"); return false; }   } }

function DisabledControls { var ddlprodnm = document.getElementById('ContentPlaceHolder1_ddlproductname'); var ddlsubprodnm = document.getElementById('ContentPlaceHolder1_dllsubproeductname'); var ddlChannel = document.getElementById('ContentPlaceHolder1_ddlchennelname'); var ddlbanknm = document.getElementById('ContentPlaceHolder1_ddlbankname'); var ddlvendornm = document.getElementById('ContentPlaceHolder1_ddlvendorname'); var txttestingstartdt = document.getElementById('ContentPlaceHolder1_txttestingstartdate'); var hdnprodnm = document.getElementById('ContentPlaceHolder1_hdnproductname'); var hdnsubproductname = document.getElementById('ContentPlaceHolder1_hdnsubproductname'); var hdnchannelname = document.getElementById('ContentPlaceHolder1_hdnchannelname'); var hdnbankname = document.getElementById('ContentPlaceHolder1_hdnbankname'); var hdnvendorname = document.getElementById('ContentPlaceHolder1_hdnvendorname'); var hdnteststartdate = document.getElementById('ContentPlaceHolder1_hdntestingstartdate'); hdnprodnm.value = ddlprodnm.value; hdnsubproductname.value = ddlsubprodnm.value; hdnchannelname.value = ddlChannel.value; hdnbankname.value = ddlbanknm.value; hdnvendorname.value = ddlvendornm.value; hdnteststartdate.value = txttestingstartdt.value; document.getElementById('ContentPlaceHolder1_ddlproductname').disabled = true; document.getElementById('ContentPlaceHolder1_dllsubproeductname').disabled = true; document.getElementById('ContentPlaceHolder1_ddlchennelname').disabled = true; document.getElementById('ContentPlaceHolder1_ddlbankname').disabled = true; document.getElementById('ContentPlaceHolder1_ddlvendorname').disabled = true; document.getElementById('ContentPlaceHolder1_txttestingstartdate').disabled = true; ddlprodnm.value = hdnprodnm.value; ddlsubprodnm.value = hdnsubproductname.value; ddlChannel.value = hdnchannelname.value; ddlbanknm.value = hdnbankname.value; ddlvendornm.value = hdnvendorname.value; txttestingstartdt.value = hdnteststartdate.value; if (fn_DateCompare('ContentPlaceHolder1_txttestingstartdate', 'ContentPlaceHolder1_txtprojectcompltiondate', 'TESTING START DATE', 'PROJECT COMPLETION DATE') == undefined) { return true; }   else return false; }

function ValTestRound(txtbx) { var filter = /^[1-5]+$/; if (filter.test(txtbx.value) == false) return false; }

function MISEditValidation { var ddlsubprodnm = document.getElementById('ddlsubproductname'); var ddlbnknm = document.getElementById('ddlbankname'); var ddlvendornm = document.getElementById('ddlvendorname'); var txttestround = document.getElementById('txtnooftesting'); var txtvenresname = document.getElementById('txtVenResourceName');

if (ddlsubprodnm.value == 0) { alert("Please select SUB PRODUCT NAME"); return false; }

if (ddlbnknm.value == 0) { alert("Please select BANK NAME"); return false; }

var fname = txttestround.value.replace(/^\s+|\s+$/g, ''); if (fname.length == 0) { alert('Please enter TESTING ROUND'); return false; }

if (isNaN(txttestround.value)) { alert("TESTING ROUND value should be numeric only."); txttestround.focus; return false; }

if (!isNormalInteger(txttestround.value)) { alert("TESTING ROUND value should be integer only."); txttestround.value = ""; txttestround.focus; return false; }

if (ValTestRound(txttestround) == undefined) { }else {       alert("TESTING ROUND value should be between 1 to 5 only."); txttestround.value = ""; txttestround.focus; return false; }

var tvenresname = txtvenresname.value.replace(/^\s+|\s+$/g, ''); if (tvenresname.length == 0) { alert("Please Enter VENDOR RESOURCE NAME"); txtvenresname.focus; return false; }

if (tvenresname.length > 50) { alert("VENDOR RESOURCE NAME length allowed upto 50 characters."); tvenresname.focus; return false; }

if (ddlvendornm.value == 0) { alert("Please select VENDOR NAME"); return false; }

if (fn_DateCompare('txttestingdt', 'txtprojectcompltiondate', 'TESTING START DATE', 'EXPECTED PROJECT COMPLETION DATE') == undefined) { }   else return false;

if (document.getElementById('txtactualcompdt').value != '') { if (fn_DateCompare('txttestingdt', 'txtactualcompdt', 'TESTING START DATE', 'ACTUAL COMPLETION DATE') == undefined) { }       else return false; } }

function MISValidation {

var ddlprodnm = document.getElementById('ContentPlaceHolder1_ddlproductname'); var ddlsubprodnm = document.getElementById('ContentPlaceHolder1_dllsubproeductname'); var ddlbnknm = document.getElementById('ContentPlaceHolder1_ddlbankname'); var ddlvendornm = document.getElementById('ContentPlaceHolder1_ddlvendorname'); var txttestround = document.getElementById('ContentPlaceHolder1_txtnooftesting'); var txtvenresname = document.getElementById('ContentPlaceHolder1_txtvenresource'); /* Common func for DDL not implemented  */ //   dropdownval(ddlprodnm, 'PRODUCT NAME') //   dropdownval(ddlsubprodnm, 'SUB PRODUCT NAME') //   dropdownval(ddlchannelnm, 'CHANNEL NAME') //   dropdownval(ddlbnknm, 'BANK NAME') //   dropdownval(ddlvendornm, 'VENDOR NAME')

if (ddlprodnm.value == 0) { alert("Please select PRODUCT NAME"); ddlprodnm.value = 0; return false; }

if (ddlsubprodnm.value == 0) { alert("Please select SUB PRODUCT NAME"); return false; }

if (ddlbnknm.value == 0) { alert("Please select BANK NAME"); return false; }

var fname = txttestround.value.replace(/^\s+|\s+$/g, ''); if (fname.length == 0) { alert('Please enter TESTING ROUND'); txttestround.focus; return false; }

if (isNaN(txttestround.value)) { alert("TESTING ROUND value should be numeric only"); txttestround.focus; return false; }

if (!isNormalInteger(txttestround.value)) { alert("TESTING ROUND value should be integer only"); txttestround.value = ""; txttestround.focus; return false; }

if (ValTestRound(txttestround) == undefined) { } else { alert("TESTING ROUND value should be between 1 to 5 only."); txttestround.value = ""; txttestround.focus; return false; }

var tvenresname = txtvenresname.value.replace(/^\s+|\s+$/g, ''); if (tvenresname.length == 0) { alert("Please Enter VENDOR RESOURCE NAME"); txtvenresname.focus; return false; }

if (tvenresname.length > 50) { alert("VENDOR RESOURCE NAME length allowed upto 50 characters."); txtvenresname.focus; return false; }

var regex = /^[a-zA-Z]*$/; if (regex.test(tvenresname.value) == false) { alert('VENDOR RESOURCE NAME allowed characters only.'); txtvenresname.focus; return false; }

if (ddlvendornm.value == 0) { alert("Please select VENDOR NAME"); return false; }

if (fn_DateCompare('ContentPlaceHolder1_txttestingstartdate', 'ContentPlaceHolder1_txtprojectcompltiondate', 'TESTING START DATE', 'EXPECTED PROJECT COMPLETION DATE') == undefined) { }       else return false; }

function ValidateMISPopup { var txtmiscomments = document.getElementById('txtcomments'); var ddlprojstatus = document.getElementById('ddlproductstatus'); var txtmiscomm = txtmiscomments.value.replace(/^\s+|\s+$/g, ''); if (txtmiscomm.length == 0) { alert('Please enter COMMENTS'); txtmiscomments.focus; return false; }

if (ddlprojstatus.value == 0) { alert("Please select PROJECT STATUS"); return false; }

if (ddlprojstatus.value == 3 || ddlprojstatus.value == 5) { if (fn_DateFormat('txtactualcompdt', 'ACTUAL COMPLETION DATE') != undefined) return false; }

if (fn_DateFormat('txtCommdt', 'DATE') != undefined) return false; }

function ValidateIssueAddPopup { var ddltestphase = document.getElementById('ddltestphases'); var txtdesc = document.getElementById('txtIssueDescription'); var ddlissuerelmod = document.getElementById('ddlissuerelatedmodul'); var ddlpertaining = document.getElementById('ddlissuepertainingto'); var ddlissuestatus = document.getElementById('ddlstatusissue'); var txtinternalcomments = document.getElementById('txtNPCIInternalcomment'); var txtextncomments = document.getElementById('txtCommentsNotesRemarks');

if (ddltestphase.value == 0) { alert("Please select TEST PHASE"); return false; }

var txtds = txtdesc.value.replace(/^\s+|\s+$/g, ''); if (txtds.length == 0) { alert('Please enter DESCRIPTION'); txtdesc.focus; return false; }

if (fn_DateFormat('txtIssueStartDate', 'ISSUE START DATE') != undefined) return false;

if (ddlissuerelmod.value == 0) { alert("Please select ISSUE RELATED MODULE"); return false; }

if (ddlpertaining.value == 0) { alert("Please select ISSUE PERTAINING TO"); return false; }

var txtinternalcomm = txtinternalcomments.value.replace(/^\s+|\s+$/g, ''); var txtextncomm = txtextncomments.value.replace(/^\s+|\s+$/g, ''); if (txtinternalcomm.length == 0) { if (txtextncomm.length == 0) { alert('Please enter NPCI Internal comment/ Certification team comments'); txtinternalcomments.focus; return false; }   }

if (ddlissuestatus.value == 0) { alert("Please select ISSUE STATUS"); return false; } }

function ValidateIssueCommentsPopup { var txtinternalcomments = document.getElementById('txtnpciinternalcomments'); var txtextncomments = document.getElementById('txtcommentsnotremarks'); var ddlissuestatus = document.getElementById('ddlissuetrackarstatus'); var txtinternalcomm = txtinternalcomments.value.replace(/^\s+|\s+$/g, ''); var txtextncomm = txtextncomments.value.replace(/^\s+|\s+$/g, ''); if (txtinternalcomm.length == 0) { if (txtextncomm.length == 0) { alert('Please enter NPCI Internal comment/ Certification team comments'); txtinternalcomments.focus; return false; }   }

if (ddlissuestatus.value == 0) { alert("Please select ISSUE STATUS"); return false; } }

function dropdownval(ddl, ddlnm) { if (ddl.value == 0) { alert("Please select " + ddlnm); return false; } }

function AlertProjClose { alert("Issue Status has not yet Closed"); return false; }

function AlerDupVal(Name) { alert(Name + " is already exists"); return false; }

function ValidateReports { if (fn_DateCompare('ContentPlaceHolder1_txtfrdate', 'ContentPlaceHolder1_txtfrto', 'FROM PERIOD', 'TO PERIOD') == undefined) { return true; }   else return false; }

function showloader { document.getElementById("imgloader").style.display = ''; }

function hideloader { document.getElementById("imgloader").style.display = 'none'; }

function ValidateUser { var txtuname = document.getElementById('ContentPlaceHolder1_txtUserName'); var txtfname = document.getElementById('ContentPlaceHolder1_txtFirstName'); var txtlname = document.getElementById('ContentPlaceHolder1_txtLastName'); var txtphone = document.getElementById('ContentPlaceHolder1_txtPhone'); var txtmobile = document.getElementById('ContentPlaceHolder1_txtMobile'); var txtemail = document.getElementById('ContentPlaceHolder1_txtEmail'); var txtdob = document.getElementById('ContentPlaceHolder1_txtDOB'); var btnSave = document.getElementById('ContentPlaceHolder1_btnSave');

var uname = txtuname.value.replace(/^\s+|\s+$/g, ''); if (uname.length == 0) { alert('Please enter USER NAME'); txtuname.focus; return false; }

var fname = txtfname.value.replace(/^\s+|\s+$/g, ''); if (fname.length == 0) { alert('Please enter FIRST NAME'); txtfname.focus; return false; }

var lname = txtlname.value.replace(/^\s+|\s+$/g, ''); if (lname.length == 0) { alert('Please enter LAST NAME'); txtlname.focus; return false; }

var txtph = txtphone.value.replace(/^\s+|\s+$/g, ''); if (txtph.length != 0) { if (!isNormalInteger(txtph)) { alert("PHONE NO. value should be in numeric only"); txtphone.value = ""; txtphone.focus; return false; }   }

var txtmob = txtmobile.value.replace(/^\s+|\s+$/g, ''); if (txtmob.length == 0) { alert('Please enter MOBILE NO.'); txtmobile.focus; return false; }

if (!isNormalInteger(txtmob)) { alert("MOBILE NO. value should be in numeric only"); txtmobile.value = ""; txtmobile.focus; return false; }

if (!(txtmob.length == 10)) { alert("Please enter 10 digit MOBILE NO."); txtmobile.focus; return false; }

var txtemailid = txtemail.value.replace(/^\s+|\s+$/g, ''); if (txtemailid.length == 0) { alert('Please enter EMAIL ID'); txtemail.select; return false; }

if (validateNPCIEmail(txtemail) == undefined) { }   else { alert('Invalid EMAIL ID'); txtemail.focus; return false; }

if (fn_DateFormat('ContentPlaceHolder1_txtDOB', 'DOB') != undefined) { return false; }

var chkActive = document.getElementById("ContentPlaceHolder1_chkIsActive"); if (btnSave.value == 'Save') { if (chkActive.checked == false) { alert("Please select IsACTIVE"); return false; }   } }

function ClearUserDetails { $('input[type="text"]').val(''); var chkActive = document.getElementById("ContentPlaceHolder1_chkIsActive"); chkActive.checked = false;

}

function keypress(event) { var lbl = document.getElementById('lblMsg'); lbl.innerHTML = ''; if (event.which == 32 || event.keyCode == 32) { lbl.innerHTML = 'SPACE BAR is not allowed'; return false; } }

function ValidateLogin { var txtuname = document.getElementById('txtuname'); var txtpass = document.getElementById('txtpass'); var lbl = document.getElementById('lblMsg'); var uname = txtuname.value.replace(/^\s+|\s+$/g, ''); if (uname.length == 0) { lbl.innerHTML = 'Please enter USERNAME'; txtuname.focus; return false; }   var pass = txtpass.value.replace(/^\s+|\s+$/g, ''); if (pass.length == 0) { lbl.innerHTML = 'Please enter PASSWORD'; txtpass.focus; return false; } }

function alphanumspcl(txtval, txtnm) { var txtvl = document.getElementById(txtval); var txtnm = document.getElementById('ContentPlaceHolder1_' + txtnm); var regex = /^[a-zA-Z0-9*)(+._\s-]*$/ if (regex.test(txtvl.value) == false) { alert('Invalid ' + txtnm.innerHTML.trim + ' [special chars ),(,-,+,. are allowed]'); txtvl.value = ''; txtvl.focus; return false; } }

function clearlbl { var lbl = document.getElementById('ContentPlaceHolder1_lblmsg'); if (lbl != null) lbl.innerHTML = ''; }

function chklen(id) { var txtbx = document.getElementById(id); if (txtbx.length > 50) { alert('Text length allowed upto 50 characters.'); txtbx.focus; return false; } }

function ClearPwdDetails { $('input[type="password"]').val(''); }

function ValPwd { var txtcurrpass = document.getElementById('ContentPlaceHolder1_txt_cpassword'); var txtnewpass = document.getElementById('ContentPlaceHolder1_txt_npassword'); var txtcnfrmpass = document.getElementById('ContentPlaceHolder1_txt_ccpassword'); var lbl = document.getElementById('ContentPlaceHolder1_lblmsg'); var cpass = txtcurrpass.value.replace(/^\s+|\s+$/g, ''); if (cpass.length == 0) { lbl.innerHTML = 'Please enter CURRENT PASSWORD'; txtcurrpass.focus; return false; }   var newpass = txtnewpass.value.replace(/^\s+|\s+$/g, ''); if (newpass.length == 0) { lbl.innerHTML = 'Please enter NEW PASSWORD'; txtnewpass.focus; return false; }   var cnfrmpass = txtcnfrmpass.value.replace(/^\s+|\s+$/g, ''); if (cnfrmpass.length == 0) { lbl.innerHTML = 'Please enter CONFIRM PASSWORD'; txtcnfrmpass.focus; return false; }   if (newpass == cnfrmpass) { return true; }   else { lbl.innerHTML = 'PASSWORD mismatch'; return false; } }

function searchajaxtxt(txt, colnm) { var txtgrid = document.getElementById(txt).value; $(document).ready(function {        $.ajax({ type: "POST", url: "MISDetails.aspx/FillmsidetailsBySearch", contentType: "application/json; charset=utf-8", data: '{"searchText":"' + txtgrid + '","searchcol":"' + colnm + '"}', dataType: "json", success: function (data) { },           error: function (data) { alert("error " + data); }       });    });    document.getElementById('ContentPlaceHolder1_btnRefresh').click; }