1$(document).ready(function () { 2 $(".hide_error").bind("keyup change", function (e) { 3 var f_id = this.id; 4 setTimeout(function () { 5 $("#er_" + f_id).html(''); 6 }, 5000); 7 }); 8 $(".only_number").keydown(function (e) { 9// Allow: backspace, delete, tab, escape, enter and . 10 if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 190]) !== -1 || 11 // Allow: Ctrl+A, Command+A 12 (e.keyCode == 65 && (e.ctrlKey === true || e.metaKey === true)) || 13 // Allow: home, end, left, right, down, up 14 (e.keyCode >= 35 && e.keyCode <= 40)) { 15 // let it happen, don't do anything 16 17 return; 18 } 19 // Ensure that it is a number and stop the keypress 20 if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { 21 e.preventDefault(); 22 showNotificationMessage('error', "Please enter number only!"); 23 } 24 }); 25 $(".onlytext").keypress(function (event) { 26 var f_id = this.id; 27 var inputValue = event.which; 28 if ((inputValue > 47 && inputValue < 58) && (inputValue != 32)) { 29 event.preventDefault(); 30 showNotificationMessage('error', "Please enter alphabet only!"); 31 } else { 32 33 } 34 }); 35 $(".alphaNum").keypress(function (e) { 36 var f_id = this.id; 37 var k; 38 document.all ? k = e.keycode : k = e.which; 39 if ((k > 47 && k < 58) || (k > 64 && k < 91) || (k > 96 && k < 123) || k == 0 || k == 32 || k == 8 || k == 127) { 40 return true; 41 } else { 42 showNotificationMessage('error', "Please enter alphabet and number only!"); 43 return false; 44 } 45 }); 46}); 47//Only number key allowed Example : onkeypress="return isNumberKey(event)" 48function isNumberKey(evt) { 49 var charCode = (evt.which) ? evt.which : event.keyCode 50 if (charCode >
50 31 && (charCode < 46 || charCode > 57 || charCode == 47)) { 51 showNotificationMessage('error', "Please enter number only!"); 52 return false; 53 } else { 54 return true; 55 } 56} 57 58 59//Alphabet and number key allowed Example : onkeypress="return isAlphaNumeric(event)" 60function isAlphaNumeric(e) { // Alphanumeric only 61 var k; 62 document.all ? k = e.keycode : k = e.which; 63 if ((k > 47 && k < 58) || (k > 64 && k < 91) || (k > 96 && k < 123) || k == 0 || k == 32 || k == 8 || k == 127) { 64 return true; 65 } else { 66 showNotificationMessage('error', "Please enter alphabet and number only!"); 67 return false; 68 } 69} 70 71//Only alphabate allowed Example : onkeypress="return isAlpha(event)" 72function isAlpha(e) { // Alphanumeric only 73 var k; 74 document.all ? k = e.keycode : k = e.which; 75 if ((k >= 65 && k <= 90) || (k >= 97 && k <= 122) || k == 0 || k == 32 || k == 8 || k == 127 || k == 9) { 76 return true; 77 } else { 78 showNotificationMessage('error', "Please enter alphabet only!"); 79 return false; 80 } 81} 82 83function erHide(id) { 84 $("#" + id).html(''); 85} 86 87function emailValidator(email) { 88 var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 89 if (email != '') { 90 var ans = regex.test(email); 91 if (ans) { 92 93 } else { 94 showNotificationMessage('error', "Please enter proper email!"); 95 } 96 } 97} 98 99function ValidateSingleInput(oInput, id, option) { 100 var _validFileExtensions; 101 if (id == '1') { 102 _validFileExtensions = [".pdf", ".doc", ".docx", ".rtf", ".text", ".html", ".ppt"]; 103 } 104 if (id == '2') { 105 _validFileExtensions = [".jpg", ".jpeg", ".bmp", ".gif", ".png"]; 106 } 107 if (id == '3') { 108 _validFileExtensions = [".mp4", ".3gp", ".avi", ".wmi", ".mpeg", ".flv"]; 109 } 110 if (id == '4') { 111 _validFileExtensions = [".jpg", ".jpeg", ".bmp", ".gif", ".png", ".pdf", ".doc", ".docx", ".rtf", ".text", ".html", ".ppt"]; 112 } 113 114 if (oInput.type == "file") { 115 var sFileName = oInput.value; 116 var countFile = oInput.files.length; 117 var fileName = oInput.files; 118 var k; 119 var fileSize; 120 var size = 0; 121 for (k = 0; k < countFile; k++) { 122 size = size + fileName[k].size; 123 } 124 if (option == '5') { 125 fileSize = 512000; 126 } else { 127 fileSize = 6291456; 128 } 129 if (size > fileSize) { 130 if (option == '5') { 131 alert("Sorry, total allowed file size : - 500KB "); 132 } else { 133 alert("Sorry, total allowed file size : - 6MB "); 134 } 135 oInput.value = ""; 136 return false; 137 } else { 138 if (sFileName.length > 0) { 139 var blnValid = false; 140 for (var j = 0; j < _validFileExtensions.length; j++) { 141 var sCurExtension = _validFileExtensions[j]; 142 if (sFileName.substr(sFileName.length - sCurExtension.length, sCurExtension.length).toLowerCase() == sCurExtension.toLowerCase()) { 143 blnValid = true; 144 break; 145 } 146 } 147 148 if (!blnValid) { 149 alert("Sorry, '" + sFileName + "' is invalid, allowed extensions are : - " + _validFileExtensions.join(", ")); 150 oInput.value = ""; 151 return false; 152 } 153 } 154 } 155 } 156 return true; 157} 158 159function emailValidator(fieldValue) { 160 var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 161 var ans = regex.test(fieldValue); 162 return ans; 163} 164 165function alphabetValidator() { 166 var alpha = /^[A-Za-z]+$/; 167 return alpha; 168} 169 170function alphabetValidator_und() { 171 var alpha = /^[a-z0-9_\-]+$/i; 172 return alpha; 173} 174 175function alphanumValidator() { 176 var alphanum = /^[0-9a-zA-Z]+$/; 177 return alphanum; 178} 179 180function mobileNoValidator() { 181 var mobno = /^\d{10}$/; 182 return mobno; 183} 184 185function panNoValidator() { 186 var panno = /[a-zA-z]{5}\d{4}[a-zA-Z]{1}/; 187 return panno; 188} 189 190function dateValidator(fieldValue) { 191 var re = /^(\d{4})-(\d{1,2})-(\d{1,2})$/; 192 if (fieldValue != '') { 193 if (regs = fieldValue.match(re)) { 194 var day = regs[3];
195 var month = regs[2]; 196 var year = regs[1]; 197 if (day < 1 || day > 31 || month < 1 || month > 12 || year < 1900) { 198 var date = false; 199 } else { 200 var date = true; 201 } 202 } else { 203 var date = false; 204 } 205 } else { 206 var date = false; 207 } 208 return date; 209} 210 211 212function formValidator(inputFields, ignore = '') { 213 if (inputFields != '') { 214 if (ignore == '') { 215 var frontendDeskType = $("#frontendDeskType").val(); 216 switch (frontendDeskType) { 217 case 'arn': 218 inputFields['branch'] = 'Please Select Valid Branch Option'; 219 inputFields['advisor'] = 'Please Select Valid Advisor Option'; 220 break; 221 case 'branch': 222 inputFields['advisor'] = 'Please Select Valid Advisor Option'; 223 break; 224 case 'advisor': 225 226 break; 227 case 'client': 228 229 break; 230 case 'broker': 231 232 break; 233 case 'employee': 234 235 break; 236 default: 237 } 238 } 239 240 var returnRespone = []; 241 var validCheck = true; 242 $.each(inputFields, function (fieldName, fieldNameMess) { 243 var fieldValue = $("#" + fieldName).val(); 244 switch (fieldName) { 245 //Only for client 246 case "searchClient": 247 case "vendorName": 248 case "vendorAddress": 249 case "itemName": 250 case "billingMonth": 251 case "billingVendorList": 252 case "paymentReference": 253 case "primaryBgColor": 254 case "primaryFontColor": 255 case "secondaryBgColor": 256 case "secondaryFontColor": 257 case "PrimaryBackgroundcolor": 258 case "SecondaryBackgroundcolor": 259 case "title": 260 case "message": 261 case "description": 262 case "name": 263 case "poptype": 264 case "popSubject": 265 case "popContent": 266 case "policyNumber": 267 case "Sel_product": 268 case "Sel_product_new": 269 case "premiumMode": 270 case "premiumTerm": 271 case "policyTerm": 272 case "praposal": 273 case "subType": 274 case "policyType": 275 case "paymentMode": 276 case "proposalNumber": 277 case "propertyName": 278 case "propertyType": 279 case "buysell": 280 case "exchange": 281 case "sell_exchange": 282 case "mergeIntoExchange": 283 case "mergeExchangecompany": 284 case "portfolioName": 285 case "fundPcode": 286 case "alreadyAddedFund": 287 case "weightStr": 288 case "investorName": 289 case "reportFormat": 290 case "emp_sal_gwt": 291 if (fieldValue.trim() == '' || fieldValue.trim() == '0') { 292 var returnVal = false;
293 } else { 294 var returnVal = true; 295 } 296 break; 297 case "loginUserName": 298 case "userPassword": 299 case "firstName": 300 case "lastName": 301 case "clientBulk": 302 case "equityuccbulk": 303 case "code": 304 case "issuerType": 305 case "gibankname": 306 case "branch1": 307 case "tenure_days": 308 case "fDIssuerNew": 309 case "fd_scheme": 310 case "receiptNo": 311 case "bankName": 312 case "postOfficeName": 313 case "account": 314 case "nomineeName": 315 case "remarks": 316 case "companyName1": 317 case "ratio": 318 case "issuerList": 319 //case "client_ids": 320 if (fieldValue.trim() == '') { 321 var returnVal = false; 322 } else { 323 var returnVal = true; 324 } 325 break; 326 //at least 3 Character for search 327 case "bdayAnniClientInput": 328 if (fieldValue.trim().length > 2) { 329 var returnVal = true; 330 } else { 331 var returnVal = false;
332 } 333 break; 334 //Blank value and zero value validation 335 case "transactionType": 336 case "totalSchm": 337 case "arnNo": 338 case "noOfMonth": 339 case "totalSchm": 340 case "financialYear": 341 case "fileToUpload": 342 case "myFile": 343 case "fundWeightage": 344 case "equityErr": 345 case "debtErr": 346 case "hybridErr": 347 case "solErr": 348 case "otherErr": 349 case "quantity": 350 351 if (fieldValue == '' || fieldValue == '0') { 352 var returnVal = false; 353 } else { 354 var returnVal = true; 355 } 356 break; 357 //Email Validation 358 case "email": 359 case "emailId": 360 case "kycEmailId": 361 case "investorEmail": 362 var ans = emailValidator(fieldValue); 363 if (!ans) { 364 var returnVal = false;
365 } else { 366 var returnVal = true; 367 } 368 break; 369 //Email Validation if value not blank 370 case "userEmail": 371 if (fieldValue.trim() !== '') { 372 var ans = emailValidator(fieldValue); 373 if (!ans) { 374 var returnVal = false; 375 } else { 376 var returnVal = true; 377 } 378 } 379 break; 380 //Alphabet Value Validation and check value not blank 381 case "transPeriod": 382 case "plAll": 383 case "plLive": 384 case "plRealised": 385 case "allFundView": 386 case "selectedFundView": 387 case "fundTypeView": 388 case "folioWiseView": 389 case "rtaType": 390 case "progressStatus": 391 case "paymentMode": 392 case "action": 393 var alphabet = alphabetValidator(); 394 if (fieldValue != '' && fieldValue.match(alphabet)) { 395 var returnVal = true; 396 } else { 397 var returnVal = false;
398 } 399 break; 400 //Alpha Numaric Value Validation 401 case "branch": 402 case "advisor": 403 case "amcScheme": 404 case "amc": 405 case "schemeName": 406 case "relation": 407 if (fieldValue != 'undefined' && fieldValue != null) { 408 var alphanum = alphanumValidator(); 409 if (fieldValue !== '' && fieldValue.match(alphanum)) { 410 var returnVal = true; 411 } else { 412 var returnVal = false; 413 } 414 } 415 break; 416 //Number Value Validation check value from input fields 417 case "selectValue": 418 if (fieldValue.trim() == '' || fieldValue.trim() == '0') { 419 var returnVal = false; 420 } else { 421 var returnVal = true; 422 } 423 break; 424 case "pincode": 425 case "addressProofPincodeAadhaar": 426 case "uidAadhaar": 427 case "passportPincode": 428 case "drivingLicensePincode": 429 case "purchaseRate": 430 case "currentRate": 431 case "area": 432 case "rate": 433 case "itemVendorId": 434 case "itemRate": 435 case "eventMonth": 436 case "doc_type": 437 case "month": 438 case "bday": 439 case "ann": 440 case "both": 441 case "addSms": 442 case "Selscheme": 443 case "amount": 444 case "premiumAmount": 445 case "policyId": 446 case "riskCoverAmt": 447 case "companyName": 448 case "year": 449 case "riskCoverage": 450 case "commodityName": 451 case "quantity": 452 case "sellRate": 453 case "advisor1": 454 case "maturityAmount": 455 case "acnumber": 456 case "acNumber": 457 case "interest": 458 case "rightprice": 459 case "portfolioId": 460 case "selectValuePostal": 461 var checkNumber = $.isNumeric(fieldValue); 462 if (!checkNumber) { 463 var returnVal = false;
464 } else { 465 var returnVal = true; 466 } 467 break; 468 case "sipamount": 469 case "sipmonth": 470 case "sipinterest": 471 case "in_amount": 472 case "in_month": 473 case "inter_rate": 474 case "cage": 475 case "eage_marr": 476 case "cmarr_exp": 477 case "ei_rate": 478 case "e_rate": 479 case "mexpense": 480 case "einflation_rate": 481 case "irate": 482 case "rage": 483 case "e_years": 484 case "post_intrest": 485 case "lamount": 486 case "duration": 487 var checkNumber = $.isNumeric(fieldValue); 488 if (!checkNumber || fieldValue == '0') { 489 var returnVal = false; 490 } else { 491 var returnVal = true; 492 } 493 break; 494 //Integer Value Validation check value from dropdown, radio button and checkbox 495 case "fnd_dtl": 496 case "fnd_smry": 497 case "fnd_graph": 498 case "monthSelect": 499 case "yearSelect": 500 case "itemVendorId": 501 if (isNaN(fieldValue)) { 502 var returnVal = false;
503 } else { 504 var returnVal = true; 505 } 506 break; 507 //Integer and check 1 or 2 Value Validation 508 case "reportViewType": 509 case "ptype": 510 case "selectViewBy": 511 case "view": 512 case "lTrans": 513 case "vafunds": 514 case "fundTypeWise": 515 if (isNaN(fieldValue)) { 516 var returnVal = false; 517 } else { 518 if (fieldValue == 1 || fieldValue == 2) { 519 var returnVal = true; 520 } else { 521 var returnVal = false; 522 } 523 } 524 break; 525 //Integer and check 1 or 2 Value Validation when value not blank 526 case "status": 527 if (fieldValue != '') { 528 if (isNaN(fieldValue)) { 529 var returnVal = false;
530 } else { 531 if (fieldValue == 1 || fieldValue == 2) { 532 var returnVal = true; 533 } else { 534 var returnVal = false; 535 } 536 } 537 } 538 break; 539 //Integer and check 1, 2 or 3 Value Validation 540 case "transType": 541 case "brokerageType": 542 if (isNaN(fieldValue)) { 543 var returnVal = false; 544 } else { 545 if (fieldValue == 1 || fieldValue == 2 || fieldValue == 3) { 546 var returnVal = true; 547 } else { 548 var returnVal = false; 549 } 550 } 551 break; 552 //Integer and check 1 Value Validation especially for checkbox 553 case "dividendHistoryCheck": 554 case "financialYearCheck": 555 case "notionalDividendHistoryCheck": 556 if (isNaN(fieldValue)) { 557 var returnVal = false;
558 } else { 559 if (fieldValue == 1) { 560 var returnVal = true; 561 } else { 562 var returnVal = false; 563 } 564 } 565 break; 566 //Integer Value Validation if value not blank 567 case "trnsdur": 568 if (fieldValue != '' && isNaN(fieldValue)) { 569 var returnVal = false; 570 } else { 571 var returnVal = true; 572 } 573 break; 574 575 //Alphabet Value Validation if value blank 576 case "ftype": 577 var alphabet = alphabetValidator(); 578 var alp_und = alphabetValidator_und(); 579 if (fieldValue === '' || fieldValue === 'sol oriented' || fieldValue.match(alphabet) || fieldValue.match(alp_und)) { 580 var returnVal = true; 581 } else { 582 var returnVal = false;
583 } 584 break; 585 //Out Put In Validation 586 case "reportOutput": 587 var chk = 0; 588 if ($('#reportViewOption_print_s').val() != 'S' || $('#reportViewOption_print_d').val() != 'D' || 589 $('#reportViewOption_pdf_s').val() != 'S' || $('#reportViewOption_pdf_d').val() != 'D' || 590 $('#reportViewOption_excel_s').val() != 'S' || $('#reportViewOption_excel_d').val() != 'D') { 591 chk = 1; 592 } 593 if (chk == 1) { 594 var returnVal = false; 595 } else { 596 var returnVal = true; 597 } 598 break; 599 //Mobile Number validation 600 case "mobile": 601 case "kycMobileNo": 602 var mobno = mobileNoValidator(); 603 if (fieldValue.match(mobno)) { 604 var returnVal = true; 605 } else { 606 var returnVal = false;
607 } 608 break; 609 case "userMobileNo": 610 if (fieldValue.trim() !== '') { 611 var mobno = mobileNoValidator(); 612 if (fieldValue.match(mobno)) { 613 var returnVal = true; 614 } else { 615 var returnVal = false; 616 } 617 } 618 break; 619 // PanNumber Validation 620 case "panNo": 621 case "panno": 622 case "idenityPanNo": 623 var panno = panNoValidator(); 624 var checkPanNumber = fieldValue.match(panno); 625 if (!checkPanNumber) { 626 var returnVal = false; 627 } else { 628 var returnVal = true; 629 } 630 break; 631 //Date Validation 632 case "DOI": 633 case "DOM": 634 case "DOB": 635 case "toDate": 636 case "fromDate": 637 case "frormDate": 638 case "onGoingFromDate": 639 case "onGoingToDate": 640 case "startDate": 641 case "endDate": 642 case "valuationDate": 643 case "aumReportDate": 644 case "paymentDate": 645 case "joinDate": 646 case "date": 647 case "dob": 648 case "doc": 649 case "policyStartDate": 650 case "renewalDate": 651 case "purshaseDate": 652 case "sellDate": 653 case "mdate": 654 case "equitydate": 655 case "actionDate": 656 var date = dateValidator(fieldValue); 657 var returnVal = date; 658 break; 659 660 default: 661 break; 662 } 663 if (returnVal === false) { 664 validCheck = returnVal; 665 returnRespone["status"] = returnVal; 666 returnRespone["fieldName"] = fieldName; 667 returnRespone["errorMess"] = fieldNameMess; 668 return false; 669 //return returnRespone; 670 } 671 }); 672 if (validCheck === true) { 673 returnRespone["status"] = true; 674 returnRespone["fieldName"] = ""; 675 returnRespone["errorMess"] = "valid"; 676 } 677 return returnRespone; 678} 679} 680 681function formValidatorAutoInc(inputFields, cat_count = 0) { 682 if (inputFields != '') { 683 var returnRespone = []; 684 var validCheck = true; 685 $.each(inputFields, function (fieldName, fieldNameMess) { 686 if (cat_count > 0) { 687 for (var i = 1; i <= cat_count; i++) { 688 var fieldValue = $("#" + fieldName + i).val(); 689 switch (fieldName) { 690 // Integer value validation 691 case "minRange": 692 case "maxRange": 693 case "profileMin": 694 case "profileMax": 695 var checkNumber = $.isNumeric(fieldValue); 696 if (!checkNumber) { 697 var returnVal = false;
698 } else { 699 var returnVal = true; 700 } 701 break; 702 //Alphabet Value Validation if value blank 703 case "categoryName": 704 case "profileName": 705 if (fieldValue !== '') { 706 var returnVal = true; 707 } else { 708 var returnVal = false; 709 } 710 break; 711 712 default: 713 break; 714 } 715 if (returnVal === false) { 716 validCheck = returnVal; 717 returnRespone["status"] = returnVal; 718 returnRespone["fieldName"] = fieldName + i; 719 returnRespone["errorMess"] = fieldNameMess; 720 return false; 721 //return returnRespone; 722 } 723 724 } 725 //return false; 726 } 727 }); 728 if (validCheck === true) { 729 returnRespone["status"] = true; 730 returnRespone["fieldName"] = ""; 731 returnRespone["errorMess"] = "valid"; 732 } 733 return returnRespone; 734} 735} 736 737function formValidationCheck(inputFields, ignore) { 738 if (inputFields != '') { 739 if (ignore == '') { 740 var frontendDeskType = $("#frontendDeskType").val(); 741 switch (frontendDeskType) { 742 case 'arn': 743 inputFields['branch'] = 'select branch'; 744 inputFields['advisor'] = 'select advisor'; 745 break; 746 case 'branch': 747 inputFields['advisor'] = 'select advisor'; 748 break; 749 case 'advisor': 750 751 break; 752 case 'client': 753 754 break; 755 case 'broker': 756 757 break; 758 case 'employee': 759 760 break; 761 default: 762 } 763 } 764 var i; 765 var returnRespone = {}; 766 $.each(inputFields, function (fieldName, fieldNameMess) { 767 var fieldValue = $("#" + fieldName).val(); 768 769 if (fieldName != 'trnsdur' && fieldName != 'ftype') { 770 if ((fieldValue == '') || (fieldValue == '0')) { 771 returnRespone["status"] = false; 772 returnRespone["fieldName"] = fieldName; 773 returnRespone["errorMess"] = 'Please ' + fieldNameMess; 774 return false; 775 } 776 } 777 778 //Email Validation 779 var emailFieldNameArray = ["email", "emailId", "kycEmailId", "senderMail"]; 780 if ($.inArray(fieldName, emailFieldNameArray) !== -1) { 781 //if (fieldName == 'email') { 782 var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 783 var ans = regex.test(fieldValue); 784 if (!ans) { 785 returnRespone["status"] = false; 786 returnRespone["fieldName"] = fieldName; 787 returnRespone["errorMess"] = 'Please enter a valid Email'; 788 return false; 789 } 790 } 791 792 793 //Alphabet Value Validation and check value not blanck 794 var alphaFieldNameArray = ["plAll", "plLive", "plRealised", "allFundView", "selectedFundView", "fundTypeView", "folioWiseView"]; 795 if ($.inArray(fieldName, alphaFieldNameArray) !== -1) { 796 var alpha = /^[A-Za-z]+$/; 797 if (fieldValue != '' && fieldValue.match(alpha)) { 798 return true; 799 } else { 800 returnRespone["status"] = false; 801 returnRespone["fieldName"] = fieldName; 802 returnRespone["errorMess"] = 'Please ' + fieldNameMess; 803 return false; 804 } 805 } 806 807 808 809 //Alpha Numaric Value Validation 810 var alpnumFieldNameArray = ["branch", "advisor"]; 811 if ($.inArray(fieldName, alpnumFieldNameArray) !== -1) { 812 var alpnum = /^[0-9a-zA-Z]+$/; 813 if (fieldValue !== null && fieldValue !== '' && fieldValue.match(alpnum)) { 814 return true; 815 } else { 816 returnRespone["status"] = false;
817 returnRespone["fieldName"] = fieldName; 818 returnRespone["errorMess"] = 'Please ' + fieldNameMess; 819 return false; 820 } 821 } 822 823 //Number Value Validation check value from input fields 824 var numberFieldArray = ["acc_no", "bseMappingBankAcNO1", "micr_no", "pincode", "addressProofPincodeAadhaar", "uidAadhaar", "passportPincode", "drivingLicensePincode", "purchaseRate", "currentRate", "area", "quantity", "rate", "ach_amount"]; 825 if ($.inArray(fieldName, numberFieldArray) !== -1) { 826 var checkNumber = $.isNumeric(fieldValue); 827 if (!checkNumber) { 828 returnRespone["status"] = false; 829 returnRespone["fieldName"] = fieldName; 830 returnRespone["errorMess"] = 'Please Enter Number'; 831 return false; 832 } 833 } 834 835 //Integer Value Validation check value from dropdown, radio button and checkbox 836 var integerFieldNameArray = ["selectValue", "fnd_dtl", "fnd_smry", "fnd_graph"]; 837 if ($.inArray(fieldName, integerFieldNameArray) !== -1) { 838 if (isNaN(fieldValue)) { 839 returnRespone["status"] = false; 840 returnRespone["fieldName"] = fieldName; 841 returnRespone["errorMess"] = 'Please ' + fieldNameMess; 842 return false; 843 } else { 844 return true; 845 } 846 } 847 848 //Integer and check 1 or 2 Value Validation 849 var intonetwoFieldNameArray = ["selectViewBy", "lTrans", "vafunds", "fundTypeWise"]; 850 if ($.inArray(fieldName, intonetwoFieldNameArray) !== -1) { 851 if (isNaN(fieldValue)) { 852 returnRespone["status"] = false; 853 returnRespone["fieldName"] = fieldName; 854 returnRespone["errorMess"] = 'Please ' + fieldNameMess; 855 return false; 856 } else { 857 if (fieldValue == 1 || fieldValue == 2) { 858 return true; 859 } else { 860 returnRespone["status"] = false; 861 returnRespone["fieldName"] = fieldName; 862 returnRespone["errorMess"] = 'Please ' + fieldNameMess; 863 return false; 864 } 865 } 866 } 867 868 //Integer Value Validation if value not blanck 869 var trnsdurWiseFieldNameArray = ["trnsdur"]; 870 if ($.inArray(fieldName, trnsdurWiseFieldNameArray) !== -1) { 871 if (fieldValue != '' || isNaN(fieldValue)) { 872 returnRespone["status"] = false; 873 returnRespone["fieldName"] = fieldName; 874 returnRespone["errorMess"] = 'Please Select Valid Transaction Duration'; 875 return false; 876 } else { 877 return true; 878 } 879 } 880 881 882 //Alphabet Value Validation if value not blanck 883 var trnsdurWiseFieldNameArray = ["ftype"]; 884 if ($.inArray(fieldName, trnsdurWiseFieldNameArray) !== -1) { 885 var alpha = /^[A-Za-z]+$/; 886 if (fieldValue == '' || fieldValue.match(alpha)) { 887 return true; 888 } else { 889 returnRespone["status"] = false; 890 returnRespone["fieldName"] = fieldName; 891 returnRespone["errorMess"] = 'Please Select Valid Transaction Duration'; 892 return false; 893 } 894 } 895 896 //Out Put In Validation 897 var reportOutputWiseFieldNameArray = ["reportOutput"]; 898 if ($.inArray(fieldName, reportOutputWiseFieldNameArray) !== -1) { 899 var chk = 0; 900 if ($('#reportViewOption_print_s').val() != 'S' || $('#reportViewOption_print_d').val() != 'D') { 901 chk = 1; 902 } 903 if ($('#reportViewOption_pdf_s').val() != 'S' || $('#reportViewOption_pdf_d').val() != 'D') { 904 chk = 1; 905 } 906 if ($('#reportViewOption_excel_s').val() != 'S' || $('#reportViewOption_excel_d').val() != 'D') { 907 chk = 1; 908 } 909 if (chk == 1) { 910 returnRespone["status"] = false;
911 returnRespone["fieldName"] = fieldName; 912 returnRespone["errorMess"] = 'Please Select Valid Out Put In'; 913 return false; 914 } else { 915 return true; 916 } 917 } 918 919 //Mobile Number validation 920 //if (fieldName == 'mobile') { 921 var mobileFieldNameArray = ["mobile", "kycMobileNo"]; 922 if ($.inArray(fieldName, mobileFieldNameArray) !== -1) { 923 var phoneno = /^\d{10}$/; 924 if (fieldValue.match(phoneno)) { 925 return true; 926 } else { 927 returnRespone["status"] = false; 928 returnRespone["fieldName"] = fieldName; 929 returnRespone["errorMess"] = 'Please Enter Valid Mobile Number'; 930 return false; 931 } 932 } 933 934 //Date Validation 935 var fieldNameArray = ["DOI", "DOM", "DOB", "fromDate", "toDate", "onGoingFromDate", "onGoingToDate", "startDate", "endDate"]; 936 if ($.inArray(fieldName, fieldNameArray) !== -1) { 937 var re = /^(\d{4})-(\d{1,2})-(\d{1,2})$/; 938 if (fieldValue != '') { 939 if (regs = fieldValue.match(re)) { 940 // day value between 1 and 31 941 if (regs[3] < 1 || regs[3] > 31) { 942 returnRespone["status"] = false; 943 returnRespone["fieldName"] = fieldName; 944 returnRespone["errorMess"] = 'Invalid Value For Day'; 945 return false; 946 } 947 // month value between 1 and 12 948 if (regs[2] < 1 || regs[2] > 12) { 949 returnRespone["status"] = false; 950 returnRespone["fieldName"] = fieldName; 951 returnRespone["errorMess"] = 'Invalid Value For Month'; 952 return false; 953 } 954 // year value between 1902 and 2018 955// regs[1] < 1902 || regs[1] > (new Date()).getFullYear() 956 if (regs[1] < 1902) { 957 returnRespone["status"] = false; 958 returnRespone["fieldName"] = fieldName; 959 returnRespone["errorMess"] = "Invalid value for year: " + regs[3] + " - must be between 1902 and " + (new Date()).getFullYear(); 960 return false; 961 } 962 } else { 963 returnRespone["status"] = false; 964 returnRespone["fieldName"] = fieldName; 965 returnRespone["errorMess"] = 'Invalid Date format'; 966 return false; 967 } 968 } 969 } 970 971 972 // PanNumber Validation 973 var numberFieldArray = ["panNo", "panno", "idenityPanNo", "panNo", "client_pan"]; 974 if ($.inArray(fieldName, numberFieldArray) !== -1) { 975 console.log(fieldName + "pan " + fieldValue.length); 976 if (fieldValue.length <= 10) { 977 var panNorRegExp = /[a-zA-z]{5}\d{4}[a-zA-Z]{1}/; 978 var checkPanNumber = fieldValue.match(panNorRegExp); 979 if (!checkPanNumber) { 980 returnRespone["status"] = false; 981 returnRespone["fieldName"] = fieldName; 982 returnRespone["errorMess"] = 'Please Enter Valid Pan No'; 983 return false; 984 } 985 } else { 986 returnRespone["status"] = false; 987 returnRespone["fieldName"] = fieldName; 988 returnRespone["errorMess"] = 'Please Enter Valid Pan No'; 989 return false; 990 } 991 } 992 993 }); 994 return returnRespone; 995 } 996} 997 998function showNotificationMessage(msgType, msg) { 999 var className = ""; 1000 switch (msgType) { 1001 case "success": 1002 className = "alert-success"; 1003 $('#notificationDiv').removeClass('alert-danger'); 1004 $('#notificationDiv').removeClass('alert-warning'); 1005 $('#notificationDiv').removeClass('alert-info'); 1006 1007 break; 1008 case "error": 1009 className = "alert-danger"; 1010 $('#notificationDiv').removeClass('alert-success'); 1011 $('#notificationDiv').removeClass('alert-warning'); 1012 $('#notificationDiv').removeClass('alert-info'); 1013 break; 1014 case "warning": 1015 className = "alert-warning"; 1016 $('#notificationDiv').removeClass('alert-danger'); 1017 $('#notificationDiv').removeClass('alert-success'); 1018 $('#notificationDiv').removeClass('alert-info'); 1019 break; 1020 case "info": 1021 className = "alert-info"; 1022 $('#notificationDiv').removeClass('alert-danger'); 1023 $('#notificationDiv').removeClass('alert-warning'); 1024 $('#notificationDiv').removeClass('alert-success'); 1025 break; 1026 } 1027 1028 $('#notificationDiv').addClass(className); 1029 $('#notificationDiv').addClass("in"); 1030 $('#notificationParentDiv').removeClass("d-none"); 1031 $('#notificationParentDiv').addClass("d-block"); 1032 $('#notificationParentDiv').css({'right': '0px', 'position': 'fixed', 'z-index': '1000001', 'width': '40%', 'top': '0px'}); 1033 $('#notificationMsg').html(msg); 1034 setTimeout(function () { 1035 $('#notificationParentDiv').slideUp(5000); 1036 setTimeout(function () { 1037 $('#notificationParentDiv').removeClass("d-block"); 1038 $('#notificationParentDiv').addClass("d-none"); 1039 }, 5000); 1040 }, 5000); 1041} 1042 1043function closeNotification() { 1044 $('#notificationParentDiv').addClass("d-none"); 1045 $('#notificationParentDiv').removeClass("d-block"); 1046 $('#notificationMsg').html(""); 1047}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.