How to use notEmpty method in Jest

Best JavaScript code snippet using jest

scripts.js

Source:scripts.js Github

copy

Full Screen

1$(document).ready(function() { //id of the form2 $('#form_mkby').bootstrapValidator({ //options of validator3 feedbackIcons: {4 valid: 'glyphicon glyphicon-ok', //icons5 invalid: 'glyphicon glyphicon-remove',6 validating: 'glyphicon glyphicon-refresh'7 },8 fields: {9 saving: {10 validators: {11 notEmpty: {12 message: 'Please enter the saving number'13 }14 }15 },16 name: {17 validators: {18 notEmpty: {19 message: 'The Name is required and cannot be empty'20 },21 stringLength: {22 max: 30,23 message: 'The FULL NAME must be less than 30 characters long'24 }25 }26 },27 fname: {28 validators: {29 notEmpty: {30 message: 'The FIRST NAME is required and cannot be empty'31 },32 stringLength: {33 max: 20,34 message: 'The FIRST NAME must be less than 20 characters long'35 }36 }37 },38 dob: {39 validators: {40 notEmpty: {41 message: 'Please select the DATE OF BIRTH'42 }43 }44 },45 address: {46 validators: {47 notEmpty: {48 message: 'The Address Cannot be Empty'49 }50 }51 },52 amountf: {53 validators: {54 notEmpty: {55 message: 'The Amount Cannot be Empty'56 }57 }58 },59 amountw: {60 validators: {61 notEmpty: {62 message: 'The Amount Cannot be Empty'63 }64 }65 },66 mode: {67 validators: {68 notEmpty: {69 message: 'The Mode Cannot be Empty'70 }71 }72 },73 namen: {74 validators: {75 notEmpty: {76 message: 'The Nominee Name Cannot be Empty'77 }78 }79 }, 80 name_add: {81 validators: {82 notEmpty: {83 message: 'The NAME and Address is required and cannot be empty'84 }85 }86 },87 name_a: {88 validators: {89 notEmpty: {90 message: 'The NAME and Witness is required and cannot be empty'91 }92 }93 },94 aadhar_no: {95 validators: {96 notEmpty: {97 message: 'Aadhar Number is required cannot be empty'98 },99 stringLength: {100 min: 12,101 max: 12,102 message: 'Aadhar Numbe cannot be greater than 12 characters'103 }104 }105 },106 107 108 }109 });110});111 $('#form_bsy').bootstrapValidator({ //options of validator112 feedbackIcons: {113 valid: 'glyphicon glyphicon-ok', //icons114 invalid: 'glyphicon glyphicon-remove',115 validating: 'glyphicon glyphicon-refresh'116 },117 fields: {118 applicant_name: {119 validators: {120 notEmpty: {121 message: 'Please enter the Applicant Name'122 },123 stringLength: {124 max: 20,125 message: 'The Applicant Name must be less than 20 characters long'126 }127 }128 },129 husband_name: {130 validators: {131 notEmpty: {132 message: 'The Husband Name is required and cannot be empty'133 },134 stringLength: {135 max: 20,136 message: 'The Husband Name must be less than 20 characters long'137 }138 }139 },140 son_of: {141 validators: {142 notEmpty: {143 message: 'The Son Of Field is required and cannot be empty'144 },145 stringLength: {146 max: 20,147 message: 'The Son Of Field must be less than 20 characters long'148 }149 }150 },151 dob_mother: {152 validators: {153 notEmpty: {154 message: 'Please select the DATE OF BIRTH of MOTHER'155 }156 }157 },158 dob_child: {159 validators: {160 notEmpty: {161 message: 'Please select the DATE OF BIRTH of Child'162 }163 }164 }, 165 birth_place: {166 validators: {167 notEmpty: {168 message: 'Please enter the Place of Birth'169 }170 }171 },172 no_of_child: {173 validators: {174 notEmpty: {175 message: 'Please enter the Number of Children'176 }177 }178 },179 address: {180 validators: {181 notEmpty: {182 message: 'The Address Cannot be Empty'183 }184 }185 },186 187 amount_figures: {188 validators: {189 notEmpty: {190 message: 'The Amount Cannot be Empty'191 }192 }193 },194 amount_words: {195 validators: {196 notEmpty: {197 message: 'The Amount in Words Cannot be Empty'198 }199 }200 },201 policy_no: {202 validators: {203 notEmpty: {204 message: 'The Policy Number Cannot be Empty'205 }206 }207 },208 aadhar_no: {209 validators: {210 notEmpty: {211 message: 'Aadhar Number is required cannot be empty'212 },213 stringLength: {214 min: 12,215 max: 12,216 message: 'Aadhar Numbe cannot be greater than 12 characters'217 }218 }219 },220 221 222 }223 });224 $('#form_jsy').bootstrapValidator({ //options of validator225 feedbackIcons: {226 valid: 'glyphicon glyphicon-ok', //icons227 invalid: 'glyphicon glyphicon-remove',228 validating: 'glyphicon glyphicon-refresh'229 },230 fields: {231 sub_center: {232 validators: {233 notEmpty: {234 message: 'Please enter the name of Subcenter'235 },236 stringLength: {237 max: 20,238 message: 'The Husband Name must be less than 20 characters long'239 }240 }241 },242 husband_name: {243 validators: {244 notEmpty: {245 message: 'The Husband Name is required and cannot be empty'246 },247 stringLength: {248 max: 20,249 message: 'The Husband Name must be less than 20 characters long'250 }251 }252 },253 phc: {254 validators: {255 notEmpty: {256 message: 'This is required and cannot be empty'257 },258 stringLength: {259 max: 20,260 message: 'This must be less than 20 characters long'261 }262 }263 },264 applicant_name: {265 validators: {266 notEmpty: {267 message: 'Please enter the Applicant Name'268 },269 stringLength: {270 max: 20,271 message: 'The Husband Name must be less than 20 characters long'272 }273 }274 },275 bpl_card_no: {276 validators: {277 notEmpty: {278 message: 'Please select the BPL CARD NOs'279 }280 }281 },282 date: {283 validators: {284 notEmpty: {285 message: 'Please select the DATE'286 }287 }288 }, 289 registration_no: {290 validators: {291 notEmpty: {292 message: 'Please enter the Registration number'293 }294 }295 },296 age: {297 validators: {298 notEmpty: {299 message: 'Please enter the Age'300 }301 }302 },303 imp: {304 validators: {305 notEmpty: {306 message: 'Please enter the Imp'307 }308 }309 },310 edd: {311 validators: {312 notEmpty: {313 message: 'Please enter the EDD'314 }315 }316 },317 health_inst: {318 validators: {319 notEmpty: {320 message: 'Please enter the Health Insurance'321 }322 }323 },324 address: {325 validators: {326 notEmpty: {327 message: 'The Address Cannot be Empty'328 }329 }330 },331 332 amount_figures: {333 validators: {334 notEmpty: {335 message: 'The Amount Cannot be Empty'336 }337 }338 },339 amount_words: {340 validators: {341 notEmpty: {342 message: 'The Amount in Words Cannot be Empty'343 }344 }345 },346 policy_no: {347 validators: {348 notEmpty: {349 message: 'The Policy Number Cannot be Empty'350 }351 }352 },353 aadhar_no: {354 validators: {355 notEmpty: {356 message: 'Aadhar Number is required cannot be empty'357 },358 stringLength: {359 min: 12,360 max: 12,361 message: 'Aadhar Numbe cannot be greater than 12 characters'362 }363 }364 },365 366 367 }368 });369 $('#form_pmuy').bootstrapValidator({ //options of validator370 feedbackIcons: {371 valid: 'glyphicon glyphicon-ok', //icons372 invalid: 'glyphicon glyphicon-remove',373 validating: 'glyphicon glyphicon-refresh'374 },375 fields: {376 fname: {377 validators: {378 notEmpty: {379 message: 'Please enter the name '380 },381 stringLength: {382 max: 20,383 message: 'The Husband Name must be less than 20 characters long'384 }385 }386 },387 mname: {388 validators: {389 notEmpty: {390 message: 'The Middle Name is required and cannot be empty'391 },392 stringLength: {393 max: 20,394 message: 'The Husband Name must be less than 20 characters long'395 }396 }397 },398 lname: {399 validators: {400 notEmpty: {401 message: 'This is required and cannot be empty'402 },403 stringLength: {404 max: 20,405 message: 'This must be less than 20 characters long'406 }407 }408 },409 poa: {410 validators: {411 notEmpty: {412 message: 'Please enter the Applicant Name'413 },414 stringLength: {415 max: 20,416 message: 'This must be less than 20 characters long'417 }418 }419 },420 bpl_card_no: {421 validators: {422 notEmpty: {423 message: 'Please select the BPL CARD NOs'424 }425 }426 },427 dob: {428 validators: {429 notEmpty: {430 message: 'Please select the DATE'431 }432 }433 }, 434 registration_no: {435 validators: {436 notEmpty: {437 message: 'Please enter the Registration number'438 }439 }440 },441 age: {442 validators: {443 notEmpty: {444 message: 'Please enter the Age'445 }446 }447 },448 relation: {449 validators: {450 notEmpty: {451 message: 'Please enter the Relationship'452 }453 }454 },455 name: {456 validators: {457 notEmpty: {458 message: 'Please enter the name'459 }460 }461 },462 name_a: {463 validators: {464 notEmpty: {465 message: 'Please enter the name in aadhar card'466 }467 }468 },469 name_bank: {470 validators: {471 notEmpty: {472 message: 'Please enter the Name in Bank Account'473 }474 }475 },476 bank_no: {477 validators: {478 notEmpty: {479 message: 'Please enter the Bank Account No'480 }481 }482 },483 status: {484 validators: {485 notEmpty: {486 message: 'Please enter the status of issue'487 }488 }489 },490 bankname: {491 validators: {492 notEmpty: {493 message: 'Please enter the name of the bank'494 }495 }496 },497 branchname: {498 validators: {499 notEmpty: {500 message: 'Please enter the Bank Branch'501 }502 }503 },504 ifsc: {505 validators: {506 notEmpty: {507 message: 'Please enter the Ifsc Code '508 },509 stringLength: {510 min: 15,511 max: 15,512 message: 'The IFSC cannot be greater than 15 characters'513 }514 }515 },516 ration_no: {517 validators: {518 notEmpty: {519 message: 'Please enter the ration card no'520 }521 },522 stringLength: {523 min: 10,524 max: 10,525 message: 'Ration Card cannot be greater than 10 characters'526 }527 528 }, 529 address: {530 validators: {531 notEmpty: {532 message: 'The Address Cannot be Empty'533 }534 }535 },536 aadhar_no: {537 validators: {538 notEmpty: {539 message: 'Aadhar Number is required cannot be empty'540 },541 stringLength: {542 min: 12,543 max: 12,544 message: 'Aadhar Numbe cannot be greater than 12 characters'545 }546 }547 },548 aadhar: {549 validators: {550 notEmpty: {551 message: 'Aadhar Number is required cannot be empty'552 },553 stringLength: {554 min: 12,555 max: 12,556 message: 'Aadhar Numbe cannot be greater than 12 characters'557 }558 }559 },560 561 562 }563 });564$('#form_vpby').bootstrapValidator({ //options of validator565 feedbackIcons: {566 valid: 'glyphicon glyphicon-ok', //icons567 invalid: 'glyphicon glyphicon-remove',568 validating: 'glyphicon glyphicon-refresh'569 },570 fields: {571 name_pensioner: {572 validators: {573 notEmpty: {574 message: 'Please enter the name '575 },576 stringLength: {577 max: 20,578 message: 'The Name of Pensioner must be less than 20 characters long'579 }580 }581 },582 father_pensioner: {583 validators: {584 notEmpty: {585 message: 'The Father Name is required and cannot be empty'586 },587 stringLength: {588 max: 20,589 message: 'The father Name must be less than 20 characters long'590 }591 }592 },593 nationality: {594 validators: {595 notEmpty: {596 message: 'This is required and cannot be empty'597 },598 stringLength: {599 max: 20,600 message: 'This must be less than 20 characters long'601 }602 }603 },604 sex: {605 validators: {606 notEmpty: {607 message: 'Please enter the gender'608 },609 stringLength: {610 min:4,611 max: 10,612 message: 'This must be less than 20 characters long'613 }614 }615 },616 mobno: {617 validators: {618 notEmpty: {619 message: 'Please insert the Mobile Number'620 },621 stringLength: {622 min: 10,623 max: 10,624 message: 'This must be less than 10 digits long'625 }626 }627 },628 dob: {629 validators: {630 notEmpty: {631 message: 'Please select the DATE'632 }633 }634 }, 635 registration_no: {636 validators: {637 notEmpty: {638 message: 'Please enter the Registration number'639 }640 }641 },642 age: {643 validators: {644 notEmpty: {645 message: 'Please enter the Age'646 }647 }648 },649 bankname: {650 validators: {651 notEmpty: {652 message: 'Please enter the Name in Bank Account'653 }654 }655 },656 bank_no: {657 validators: {658 notEmpty: {659 message: 'Please enter the Bank No'660 }661 }662 },663 status: {664 validators: {665 notEmpty: {666 message: 'Please enter the status of issue'667 }668 }669 },670 bankname: {671 validators: {672 notEmpty: {673 message: 'Please enter the name of the bank'674 }675 }676 },677 branchname: {678 validators: {679 notEmpty: {680 message: 'Please enter the Bank Branch'681 }682 }683 },684 ifsc: {685 validators: {686 notEmpty: {687 message: 'Please enter the Ifsc Code '688 },689 stringLength: {690 min: 15,691 max: 15,692 message: 'The IFSC cannot be greater than 15 characters'693 }694 }695 },696 pan: {697 validators: {698 notEmpty: {699 message: 'Please enter the Pan Number'700 },701 stringLength: {702 min: 15,703 max: 15,704 message: 'The PAN Number cannot be greater than 15 characters'705 }706 }707 },708 name: {709 validators: {710 notEmpty: {711 message: 'Please enter the name'712 }713 }714 },715 mode: {716 validators: {717 notEmpty: {718 message: 'Please enter the Mode'719 }720 }721 },722 drawn: {723 validators: {724 notEmpty: {725 message: 'Please select the date to be withdrawn'726 }727 }728 },729 dat: {730 validators: {731 notEmpty: {732 message: 'Please select the Date'733 }734 }735 },736 cheque: {737 validators: {738 notEmpty: {739 message: 'Please enter the Cheque or DD no'740 }741 }742 },743 deposit: {744 validators: {745 notEmpty: {746 message: 'Please enter the Amount of deposit'747 }748 }749 },750 amt: {751 validators: {752 notEmpty: {753 message: 'Please enter the name of the bank'754 }755 }756 },757 purchase_price: {758 validators: {759 notEmpty: {760 message: 'Please enter the Purchase Price in multiple of 5'761 }762 }763 },764 mode_pension: {765 validators: {766 notEmpty: {767 message: 'Please enter the Mode of pension Installment'768 }769 }770 },771 policy_no: {772 validators: {773 notEmpty: {774 message: 'Please enter the Policy number '775 },776 stringLength: {777 min: 3,778 max: 10,779 message: 'The Policy number cannot be greater than 10 characters'780 }781 }782 },783 resno: {784 validators: {785 notEmpty: {786 message: 'Please enter the Residence no'787 },788 stringLength: {789 min: 7,790 max: 7,791 message: 'Residence no cannot be greater than 7 characters'792 }793 }794 }, 795 offno: {796 validators: {797 notEmpty: {798 message: 'Please enter the Office no'799 },800 stringLength: {801 min: 10,802 max: 10,803 message: 'Office no cannot be greater than 10 characters'804 }805 }806 }, 807 address: {808 validators: {809 notEmpty: {810 message: 'The Address Cannot be Empty'811 }812 }813 },814 type: {815 validators: {816 notEmpty: {817 message: 'The Account Type Cannot be Empty'818 }819 }820 }, 821 aadhar_no: {822 validators: {823 notEmpty: {824 message: 'Aadhar Number is required cannot be empty'825 },826 stringLength: {827 min: 12,828 max: 12,829 message: 'Aadhar Numbe cannot be greater than 12 characters'830 }831 }832 },833 aadhar: {834 validators: {835 notEmpty: {836 message: 'Aadhar Number is required cannot be empty'837 },838 stringLength: {839 min: 12,840 max: 12,841 message: 'Aadhar Numbe cannot be greater than 12 characters'842 }843 }844 },845 846 847 }848 });849$('#form_pmjjby').bootstrapValidator({ //options of validator850 feedbackIcons: {851 valid: 'glyphicon glyphicon-ok', //icons852 invalid: 'glyphicon glyphicon-remove',853 validating: 'glyphicon glyphicon-refresh'854 },855 fields: {856 name_pensioner: {857 validators: {858 notEmpty: {859 message: 'Please enter the name '860 },861 stringLength: {862 max: 20,863 message: 'The Name of Pensioner must be less than 20 characters long'864 }865 }866 },867 father_pensioner: {868 validators: {869 notEmpty: {870 message: 'The Father Name is required and cannot be empty'871 },872 stringLength: {873 max: 20,874 message: 'The father Name must be less than 20 characters long'875 }876 }877 },878 nationality: {879 validators: {880 notEmpty: {881 message: 'This is required and cannot be empty'882 },883 stringLength: {884 max: 20,885 message: 'This must be less than 20 characters long'886 }887 }888 },889 sex: {890 validators: {891 notEmpty: {892 message: 'Please enter the gender'893 },894 stringLength: {895 min:4,896 max: 10,897 message: 'This must be less than 20 characters long'898 }899 }900 },901 mobno: {902 validators: {903 notEmpty: {904 message: 'Please insert the Mobile Number'905 },906 stringLength: {907 min: 10,908 max: 10,909 message: 'This must be less than 10 digits long'910 }911 }912 },913 dob: {914 validators: {915 notEmpty: {916 message: 'Please select the DATE'917 }918 }919 }, 920 registration_no: {921 validators: {922 notEmpty: {923 message: 'Please enter the Registration number'924 }925 }926 },927 age: {928 validators: {929 notEmpty: {930 message: 'Please enter the Age'931 }932 }933 },934 bankname: {935 validators: {936 notEmpty: {937 message: 'Please enter the Name in Bank Account'938 }939 }940 },941 bank_no: {942 validators: {943 notEmpty: {944 message: 'Please enter the Bank No'945 }946 }947 },948 status: {949 validators: {950 notEmpty: {951 message: 'Please enter the status of issue'952 }953 }954 },955 bankname: {956 validators: {957 notEmpty: {958 message: 'Please enter the name of the bank'959 }960 }961 },962 branchname: {963 validators: {964 notEmpty: {965 message: 'Please enter the Bank Branch'966 }967 }968 },969 ifsc: {970 validators: {971 notEmpty: {972 message: 'Please enter the Ifsc Code '973 },974 stringLength: {975 min: 15,976 max: 15,977 message: 'The IFSC cannot be greater than 15 characters'978 }979 }980 },981 pan: {982 validators: {983 notEmpty: {984 message: 'Please enter the Pan Number'985 },986 stringLength: {987 min: 15,988 max: 15,989 message: 'The PAN Number cannot be greater than 15 characters'990 }991 }992 },993 name: {994 validators: {995 notEmpty: {996 message: 'Please enter the name'997 }998 }999 },1000 mode: {1001 validators: {1002 notEmpty: {1003 message: 'Please enter the Mode'1004 }1005 }1006 },1007 drawn: {1008 validators: {1009 notEmpty: {1010 message: 'Please select the date to be withdrawn'1011 }1012 }1013 },1014 dat: {1015 validators: {1016 notEmpty: {1017 message: 'Please select the Date'1018 }1019 }1020 },1021 cheque: {1022 validators: {1023 notEmpty: {1024 message: 'Please enter the Cheque or DD no'1025 }1026 }1027 },1028 deposit: {1029 validators: {1030 notEmpty: {1031 message: 'Please enter the Amount of deposit'1032 }1033 }1034 },1035 amt: {1036 validators: {1037 notEmpty: {1038 message: 'Please enter the name of the bank'1039 }1040 }1041 },1042 purchase_price: {1043 validators: {1044 notEmpty: {1045 message: 'Please enter the Purchase Price in multiple of 5'1046 }1047 }1048 },1049 mode_pension: {1050 validators: {1051 notEmpty: {1052 message: 'Please enter the Mode of pension Installment'1053 }1054 }1055 },1056 policy_no: {1057 validators: {1058 notEmpty: {1059 message: 'Please enter the Policy number '1060 },1061 stringLength: {1062 min: 3,1063 max: 10,1064 message: 'The Policy number cannot be greater than 10 characters'1065 }1066 }1067 },1068 resno: {1069 validators: {1070 notEmpty: {1071 message: 'Please enter the Residence no'1072 },1073 stringLength: {1074 min: 7,1075 max: 7,1076 message: 'Residence no cannot be greater than 7 characters'1077 }1078 }1079 }, 1080 offno: {1081 validators: {1082 notEmpty: {1083 message: 'Please enter the Office no'1084 },1085 stringLength: {1086 min: 10,1087 max: 10,1088 message: 'Office no cannot be greater than 10 characters'1089 }1090 }1091 }, 1092 address: {1093 validators: {1094 notEmpty: {1095 message: 'The Address Cannot be Empty'1096 }1097 }1098 },1099 type: {1100 validators: {1101 notEmpty: {1102 message: 'The Account Type Cannot be Empty'1103 }1104 }1105 }, 1106 aadhar_no: {1107 validators: {1108 notEmpty: {1109 message: 'Aadhar Number is required cannot be empty'1110 },1111 stringLength: {1112 min: 12,1113 max: 12,1114 message: 'Aadhar Numbe cannot be greater than 12 characters'1115 }1116 }1117 },1118 aadhar: {1119 validators: {1120 notEmpty: {1121 message: 'Aadhar Number is required cannot be empty'1122 },1123 stringLength: {1124 min: 12,1125 max: 12,1126 message: 'Aadhar Numbe cannot be greater than 12 characters'1127 }1128 }1129 },1130 1131 1132 }...

Full Screen

Full Screen

validator.js

Source:validator.js Github

copy

Full Screen

1//EJERCICIO 3 - TP12$(document).ready(function () {3 $('#eje3').bootstrapValidator({4 message: 'Este valor no es valido',5 feedbackIcons: {6 valid: 'glyphicon glyphicon-ok',7 invalid: 'glyphicon glyphicon-remove',8 validating: 'glyphicon glyphicon-refresh'9 },10 fields: {11 nombre: {12 message: 'Nombre no valido',13 validators: {14 notEmpty: {15 message: ' Se requiere el nombre de usuario'16 },17 regexp: {18 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,19 message: ' La primer letra en mayúscula. Solo letras.'20 }21 }22 },23 apellido: {24 message: 'Apellido no valido',25 validators: {26 notEmpty: {27 message: ' El apellido es obligatorio'28 },29 regexp: {30 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,31 message: ' La primer letra en mayúscula. Solo letras.'32 }33 }34 },35 edad: {36 message: 'Edad no valida',37 validators: {38 notEmpty: {39 message: ' La edad es obligatoria'40 }41 }42 },43 direccion: {44 message: 'Dirección invalida',45 validators: {46 notEmpty: {47 message: ' Se requiere una dirección'48 }49 }50 }51 },52 });53});54//EJERCICIO 4 - TP155$(document).ready(function () {56 $('#eje4').bootstrapValidator({57 message: 'Este valor no es valido',58 feedbackIcons: {59 valid: 'glyphicon glyphicon-ok',60 invalid: 'glyphicon glyphicon-remove',61 validating: 'glyphicon glyphicon-refresh'62 },63 fields: {64 nombre: {65 message: 'Nombre no valido',66 validators: {67 notEmpty: {68 message: ' Se requiere el nombre de usuario'69 },70 regexp: {71 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,72 message: ' La primer letra en mayúscula. Solo letras.'73 }74 }75 },76 apellido: {77 message: 'Apellido no valido',78 validators: {79 notEmpty: {80 message: ' El apellido es obligatorio'81 },82 regexp: {83 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,84 message: ' La primer letra en mayúscula. Solo letras.'85 }86 }87 },88 edad: {89 message: 'Edad no valida',90 validators: {91 notEmpty: {92 message: ' La edad es obligatoria'93 }94 }95 },96 direccion: {97 message: 'Dirección invalida',98 validators: {99 notEmpty: {100 message: ' Se requiere una dirección'101 }102 }103 }104 },105 });106});107//EJERCICIO 5 - TP1108$(document).ready(function () {109 $('#eje5').bootstrapValidator({110 message: 'Este valor no es valido',111 feedbackIcons: {112 valid: 'glyphicon glyphicon-ok',113 invalid: 'glyphicon glyphicon-remove',114 validating: 'glyphicon glyphicon-refresh'115 },116 fields: {117 nombre: {118 message: 'Nombre no valido',119 validators: {120 notEmpty: {121 message: ' Se requiere el nombre de usuario'122 },123 regexp: {124 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,125 message: ' La primer letra en mayúscula. Solo letras.'126 }127 }128 },129 apellido: {130 message: 'Apellido no valido',131 validators: {132 notEmpty: {133 message: ' El apellido es obligatorio'134 },135 regexp: {136 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,137 message: ' La primer letra en mayúscula. Solo letras.'138 }139 }140 },141 edad: {142 message: 'Edad no valida',143 validators: {144 notEmpty: {145 message: ' La edad es obligatoria'146 }147 }148 },149 direccion: {150 message: 'Dirección invalida',151 validators: {152 notEmpty: {153 message: ' Se requiere una dirección'154 }155 }156 },157 estudio: {158 validators: {159 notEmpty: {160 message: ' Se requiere seleccionar una opción'161 }162 }163 },164 sexo: {165 validators: {166 notEmpty: {167 message: ' Se requiere seleccionar una opción'168 }169 }170 }171 },172 });173});174//EJERCICIO 6 - TP1175$(document).ready(function () {176 $('#eje6').bootstrapValidator({177 message: 'Este valor no es valido',178 feedbackIcons: {179 valid: 'glyphicon glyphicon-ok',180 invalid: 'glyphicon glyphicon-remove',181 validating: 'glyphicon glyphicon-refresh'182 },183 fields: {184 nombre: {185 message: 'Nombre no valido',186 validators: {187 notEmpty: {188 message: ' Se requiere el nombre de usuario'189 },190 regexp: {191 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,192 message: ' La primer letra en mayúscula. Solo letras.'193 }194 }195 },196 apellido: {197 message: 'Apellido no valido',198 validators: {199 notEmpty: {200 message: ' El apellido es obligatorio'201 },202 regexp: {203 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,204 message: ' La primer letra en mayúscula. Solo letras.'205 }206 }207 },208 edad: {209 message: 'Edad no valida',210 validators: {211 notEmpty: {212 message: ' La edad es obligatoria'213 }214 }215 },216 direccion: {217 message: 'Dirección invalida',218 validators: {219 notEmpty: {220 message: ' Se requiere una dirección'221 }222 }223 },224 estudios: {225 validators: {226 notEmpty: {227 message: ' Se requiere seleccionar una opción'228 }229 }230 },231 sexo: {232 validators: {233 notEmpty: {234 message: ' Se requiere seleccionar una opción'235 }236 }237 }238 },239 });240});241//EJERCICIO 3 - TP2242$(document).ready(function () {243 $('#tp2ej3').bootstrapValidator({244 message: 'Este valor no es valido',245 fields: {246 username: {247 validators: {248 notEmpty: {249 message: ' El nombre de usuario es requerido'250 },251 stringLength: {252 min: 4,253 message: ' Debe superar los 4 caracteres'254 }255 }256 },257 password: {258 validators: {259 notEmpty: {260 message: ' Completar campo <br>'261 },262 regexp: {263 regexp: /(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]/,264 message: ' Debe contener letras y números <br>'265 },266 stringLength: {267 min: 8,268 message: ' Debe tener mínimo 8 caracteres <br>'269 },270 different: {271 field: 'username',272 message: ' La contraseña no debe ser igual al nombre del usuario'273 }274 }275 },276 }277 });278});279//EJERCICIO 4 - TP2280$(document).ready(function () {281 $('#eje4tp2').bootstrapValidator({282 message: 'Este valor no es valido',283 feedbackIcons: {284 valid: 'glyphicon glyphicon-ok',285 invalid: 'glyphicon glyphicon-remove',286 validating: 'glyphicon glyphicon-refresh'287 },288 fields: {289 titulo: {290 validators: {291 notEmpty: {292 message: ' Se requiere un título'293 }294 }295 },296 actores: {297 validators: {298 notEmpty: {299 message: ' Ingresar actores'300 }301 }302 },303 director: {304 validators: {305 notEmpty: {306 message: ' Se requiere el director'307 }308 }309 },310 guion: {311 validators: {312 notEmpty: {313 message: ' Se requiere un guión'314 }315 }316 },317 produccion: {318 validators: {319 notEmpty: {320 message: ' Se requiere el nombre de producción'321 }322 }323 },324 year: {325 validators: {326 notEmpty: {327 message: ' Año obligatorio'328 }329 }330 },331 nacion: {332 validators: {333 notEmpty: {334 message: ' La nacionalidad es obligatoria'335 },336 regexp: {337 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,338 message: ' La primer letra en mayúscula. Solo letras.'339 }340 }341 },342 minutos: {343 validators: {344 notEmpty: {345 message: ' Se requiere duración'346 }347 }348 },349 edad: {350 validators: {351 notEmpty: {352 message: ' Se requiere seleccionar una opción'353 }354 }355 },356 sinopsis: {357 validators: {358 notEmpty: {359 message: ' Debe añadir una descripción'360 }361 }362 }363 },364 });365});366//EJERCICIO 1 - TP3367/*368$(document).ready(function () {369 $('#tp3eje1').bootstrapValidator({370 message: 'Este valor no es valido',371 feedbackIcons: {372 valid: 'glyphicon glyphicon-ok',373 invalid: 'glyphicon glyphicon-remove',374 validating: 'glyphicon glyphicon-refresh'375 },376 fields: {377 archivo: {378 validators: {379 notEmpty: {380 message: ' Envie un archivo'381 },382 file: {383 maxSize: 1024 * 1024 * 2,384 extension: 'doc, pdf',385 type: 'application/pdf, application/msword',386 message: ' Solo se permiten archivos .pdf o .doc'387 }388 }389 }390 },391 });392});*/393//EJERCICIO 2 - TP3394$(document).ready(function () {395 $('#tp3eje2').bootstrapValidator({396 message: 'Este valor no es valido',397 feedbackIcons: {398 valid: 'glyphicon glyphicon-ok',399 invalid: 'glyphicon glyphicon-remove',400 validating: 'glyphicon glyphicon-refresh'401 },402 fields: {403 archivo: {404 validators: {405 notEmpty: {406 message: ' Envie un archivo'407 },408 file: {409 maxSize: 1024 * 1024 * 2,410 extension: 'txt',411 type: 'txt',412 message: ' Solo se permiten archivos .txt'413 }414 }415 }416 },417 });418});419//EJERCICIO 3 - TP3420$(document).ready(function () {421 $('#tp3eje3').bootstrapValidator({422 message: 'Este valor no es valido',423 feedbackIcons: {424 valid: 'glyphicon glyphicon-ok',425 invalid: 'glyphicon glyphicon-remove',426 validating: 'glyphicon glyphicon-refresh'427 },428 fields: {429 titulo: {430 validators: {431 notEmpty: {432 message: ' Se requiere un título'433 }434 }435 },436 actores: {437 validators: {438 notEmpty: {439 message: ' Ingresar actores'440 }441 }442 },443 director: {444 validators: {445 notEmpty: {446 message: ' Se requiere el director'447 }448 }449 },450 imagen: {451 validators: {452 notEmpty: {453 message: ' Se requiere seleccionar una imagen'454 },455 // file: {456 // maxSize: 683 * 1024,457 // message: ' Excede el tamaño máximo'458 // }459 },460 custom: {461 fileheight: function ($el) {462 if ($el[0].files[0].height / ($el[0].files[0].width) > 1.5) {463 return "Debe ser una relación de aspecto de 2/3"464 }465 }466 }467 },468 guion: {469 validators: {470 notEmpty: {471 message: ' Se requiere un guión'472 }473 }474 },475 produccion: {476 validators: {477 notEmpty: {478 message: ' Se requiere el nombre de producción'479 }480 }481 },482 year: {483 validators: {484 notEmpty: {485 message: ' Año obligatorio'486 }487 }488 },489 nacion: {490 validators: {491 notEmpty: {492 message: ' La nacionalidad es obligatoria'493 },494 regexp: {495 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,496 message: ' La primer letra en mayúscula. Solo letras.'497 }498 }499 },500 minutos: {501 validators: {502 notEmpty: {503 message: ' Se requiere duración'504 }505 }506 },507 edad: {508 validators: {509 notEmpty: {510 message: ' Se requiere seleccionar una opción'511 }512 }513 },514 sinopsis: {515 validators: {516 notEmpty: {517 message: ' Debe añadir una descripción'518 }519 }520 }521 },522 });523});524//EJERCICIO 2 - TP4525$(document).ready(function () {526 $('#tp4_eje2').bootstrapValidator({527 message: 'Este valor no es valido',528 feedbackIcons: {529 valid: 'glyphicon glyphicon-ok',530 invalid: 'glyphicon glyphicon-remove',531 validating: 'glyphicon glyphicon-refresh'532 },533 fields: {534 Patente: {535 validators: {536 notEmpty: {537 message: ' Debe ingresar una patente'538 },539 regexp: {540 regexp: /^[A-ZÑ]{3}\s\d{3}$/,541 message: ' Debe ser con este formato: LLL NNN.'542 }543 }544 }545 },546 });547});548//EJERCICIO 4 - TP4549$(document).ready(function () {550 $('#tp4_eje4').bootstrapValidator({551 message: 'Este valor no es valido',552 feedbackIcons: {553 valid: 'glyphicon glyphicon-ok',554 invalid: 'glyphicon glyphicon-remove',555 validating: 'glyphicon glyphicon-refresh'556 },557 fields: {558 Nombre: {559 message: 'Nombre no valido',560 validators: {561 notEmpty: {562 message: ' Se requiere el nombre de usuario'563 },564 regexp: {565 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,566 message: ' La primer letra en mayúscula. Solo letras.'567 }568 }569 },570 Apellido: {571 message: 'Apellido no valido',572 validators: {573 notEmpty: {574 message: ' El apellido es obligatorio'575 },576 regexp: {577 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,578 message: ' La primer letra en mayúscula. Solo letras.'579 }580 }581 },582 NroDni: {583 message: 'Dni no valido',584 validators: {585 notEmpty: {586 message: ' El Dni es obligatorio'587 },588 regexp: {589 regexp: /^\d{8}$/,590 message: ' Debe ingresar 8 dígitos.'591 }592 }593 },594 Domicilio: {595 message: 'Domicilio invalido',596 validators: {597 notEmpty: {598 message: ' Se requiere un domicilio'599 }600 }601 },602 fechaNac: {603 validators: {604 notEmpty: {605 message: ' Debe ingresar una fecha'606 }607 }608 },609 Telefono: {610 validators: {611 notEmpty: {612 message: ' Ingrese nro de teléfono'613 }614 }615 }616 },617 });618});619//EJERCICIO 5 - TP4620$(document).ready(function () {621 $('#tp4_eje5').bootstrapValidator({622 message: 'Este valor no es valido',623 feedbackIcons: {624 valid: 'glyphicon glyphicon-ok',625 invalid: 'glyphicon glyphicon-remove',626 validating: 'glyphicon glyphicon-refresh'627 },628 fields: {629 Patente: {630 validators: {631 notEmpty: {632 message: ' Ingrese una patente'633 },634 regexp: {635 regexp: /^[A-ZÑ]{3}\s\d{3}$/,636 message: ' Formato: LLL NNN.'637 }638 }639 },640 Marca: {641 message: 'Apellido no valido',642 validators: {643 notEmpty: {644 message: ' Ingrese una marca'645 }646 }647 },648 Duenio: {649 message: 'Dni no valido',650 validators: {651 notEmpty: {652 message: ' El Dni es obligatorio'653 },654 regexp: {655 regexp: /^\d{8}$/,656 message: ' Debe ingresar 8 dígitos.'657 }658 }659 },660 Modelo: {661 validators: {662 notEmpty: {663 message: ' Ingrese un modelo'664 }665 }666 }667 },668 });669});670//EJERCICIO 6 - TP4671$(document).ready(function () {672 $('#tp4_eje6').bootstrapValidator({673 message: 'Este valor no es valido',674 feedbackIcons: {675 valid: 'glyphicon glyphicon-ok',676 invalid: 'glyphicon glyphicon-remove',677 validating: 'glyphicon glyphicon-refresh'678 },679 fields: {680 Patente: {681 validators: {682 notEmpty: {683 message: ' Debe ingresar una patente'684 },685 regexp: {686 regexp: /^[A-ZÑ]{3}\s\d{3}$/,687 message: ' Formato: LLL NNN.'688 }689 }690 },691 Duenio: {692 message: 'Dni no valido',693 validators: {694 notEmpty: {695 message: ' El Dni es obligatorio'696 },697 regexp: {698 regexp: /^\d{8}$/,699 message: ' Debe ingresar 8 dígitos.'700 }701 }702 },703 Dnicambio: {704 message: 'Dni no valido',705 validators: {706 notEmpty: {707 message: ' El Dni es obligatorio'708 },709 regexp: {710 regexp: /^\d{8}$/,711 message: ' Debe ingresar 8 dígitos.'712 },713 different: {714 field: 'Duenio',715 message: ' Debe ser distinto al dni del dueño'716 }717 }718 }719 },720 });721});722//EJERCICIO 7 - TP4723$(document).ready(function () {724 $('#tp4_eje7').bootstrapValidator({725 message: 'Este valor no es valido',726 feedbackIcons: {727 valid: 'glyphicon glyphicon-ok',728 invalid: 'glyphicon glyphicon-remove',729 validating: 'glyphicon glyphicon-refresh'730 },731 fields: {732 NroDni: {733 validators: {734 notEmpty: {735 message: ' El Dni es obligatorio'736 },737 regexp: {738 regexp: /^\d{8}$/,739 message: ' Debe ingresar 8 dígitos.'740 }741 }742 }743 },744 });745});746//ACCION 4 - TP4747$(document).ready(function () {748 $('#accion_E7TP4').bootstrapValidator({749 message: 'Este valor no es valido',750 feedbackIcons: {751 valid: 'glyphicon glyphicon-ok',752 invalid: 'glyphicon glyphicon-remove',753 validating: 'glyphicon glyphicon-refresh'754 },755 fields: {756 Apellido: {757 message: 'Apellido no valido',758 validators: {759 notEmpty: {760 message: ' El apellido es obligatorio. '761 },762 regexp: {763 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,764 message: ' La primer letra en mayúscula. Solo letras. '765 }766 }767 },768 Nombre: {769 message: 'Nombre no valido',770 validators: {771 notEmpty: {772 message: ' Se requiere el nombre de usuario. '773 },774 regexp: {775 regexp: /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\s]*)+$/,776 message: ' La primer letra en mayúscula. Solo letras. '777 }778 }779 },780 fechaNac: {781 validators: {782 notEmpty: {783 message: ' Debe ingresar una fecha. '784 }785 }786 },787 Telefono: {788 validators: {789 notEmpty: {790 message: ' Ingrese nro de teléfono. '791 }792 }793 },794 Domicilio: {795 message: 'Domicilio invalido',796 validators: {797 notEmpty: {798 message: ' Se requiere un domicilio. '799 }800 }801 },802 },803 });...

Full Screen

Full Screen

wizard-2.js

Source:wizard-2.js Github

copy

Full Screen

1"use strict";2// Class definition3var KTWizard2 = function () {4 // Base elements5 var _wizardEl;6 var _formEl;7 var _wizard;8 var _validations = [];9 // Private functions10 var initWizard = function () {11 // Initialize form wizard12 _wizard = new KTWizard(_wizardEl, {13 startStep: 1, // initial active step number14 clickableSteps: false // to make steps clickable this set value true and add data-wizard-clickable="true" in HTML for class="wizard" element15 });16 // Validation before going to next page17 _wizard.on('beforeNext', function (wizard) {18 // Don't go to the next step yet19 _wizard.stop();20 // Validate form21 var validator = _validations[wizard.getStep() - 1]; // get validator for currnt step22 validator.validate().then(function (status) {23 if (status == 'Valid') {24 _wizard.goNext();25 KTUtil.scrollTop();26 } else {27 Swal.fire({28 text: "Sorry, looks like there are some errors detected, please try again.",29 icon: "error",30 buttonsStyling: false,31 confirmButtonText: "Ok, got it!",32 customClass: {33 confirmButton: "btn font-weight-bold btn-light"34 }35 }).then(function () {36 KTUtil.scrollTop();37 });38 }39 });40 });41 // Change event42 _wizard.on('change', function (wizard) {43 KTUtil.scrollTop();44 });45 }46 var initValidation = function () {47 // Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/48 // Step 149 _validations.push(FormValidation.formValidation(50 _formEl,51 {52 fields: {53 fname: {54 validators: {55 notEmpty: {56 message: 'First name is required'57 }58 }59 },60 lname: {61 validators: {62 notEmpty: {63 message: 'Last Name is required'64 }65 }66 },67 phone: {68 validators: {69 notEmpty: {70 message: 'Phone is required'71 }72 }73 },74 email: {75 validators: {76 notEmpty: {77 message: 'Email is required'78 },79 emailAddress: {80 message: 'The value is not a valid email address'81 }82 }83 }84 },85 plugins: {86 trigger: new FormValidation.plugins.Trigger(),87 bootstrap: new FormValidation.plugins.Bootstrap()88 }89 }90 ));91 // Step 292 _validations.push(FormValidation.formValidation(93 _formEl,94 {95 fields: {96 address1: {97 validators: {98 notEmpty: {99 message: 'Address is required'100 }101 }102 },103 postcode: {104 validators: {105 notEmpty: {106 message: 'Postcode is required'107 }108 }109 },110 city: {111 validators: {112 notEmpty: {113 message: 'City is required'114 }115 }116 },117 state: {118 validators: {119 notEmpty: {120 message: 'State is required'121 }122 }123 },124 country: {125 validators: {126 notEmpty: {127 message: 'Country is required'128 }129 }130 }131 },132 plugins: {133 trigger: new FormValidation.plugins.Trigger(),134 bootstrap: new FormValidation.plugins.Bootstrap()135 }136 }137 ));138 // Step 3139 _validations.push(FormValidation.formValidation(140 _formEl,141 {142 fields: {143 delivery: {144 validators: {145 notEmpty: {146 message: 'Delivery type is required'147 }148 }149 },150 packaging: {151 validators: {152 notEmpty: {153 message: 'Packaging type is required'154 }155 }156 },157 preferreddelivery: {158 validators: {159 notEmpty: {160 message: 'Preferred delivery window is required'161 }162 }163 }164 },165 plugins: {166 trigger: new FormValidation.plugins.Trigger(),167 bootstrap: new FormValidation.plugins.Bootstrap()168 }169 }170 ));171 // Step 4172 _validations.push(FormValidation.formValidation(173 _formEl,174 {175 fields: {176 locaddress1: {177 validators: {178 notEmpty: {179 message: 'Address is required'180 }181 }182 },183 locpostcode: {184 validators: {185 notEmpty: {186 message: 'Postcode is required'187 }188 }189 },190 loccity: {191 validators: {192 notEmpty: {193 message: 'City is required'194 }195 }196 },197 locstate: {198 validators: {199 notEmpty: {200 message: 'State is required'201 }202 }203 },204 loccountry: {205 validators: {206 notEmpty: {207 message: 'Country is required'208 }209 }210 }211 },212 plugins: {213 trigger: new FormValidation.plugins.Trigger(),214 bootstrap: new FormValidation.plugins.Bootstrap()215 }216 }217 ));218 // Step 5219 _validations.push(FormValidation.formValidation(220 _formEl,221 {222 fields: {223 ccname: {224 validators: {225 notEmpty: {226 message: 'Credit card name is required'227 }228 }229 },230 ccnumber: {231 validators: {232 notEmpty: {233 message: 'Credit card number is required'234 },235 creditCard: {236 message: 'The credit card number is not valid'237 }238 }239 },240 ccmonth: {241 validators: {242 notEmpty: {243 message: 'Credit card month is required'244 }245 }246 },247 ccyear: {248 validators: {249 notEmpty: {250 message: 'Credit card year is required'251 }252 }253 },254 cccvv: {255 validators: {256 notEmpty: {257 message: 'Credit card CVV is required'258 },259 digits: {260 message: 'The CVV value is not valid. Only numbers is allowed'261 }262 }263 }264 },265 plugins: {266 trigger: new FormValidation.plugins.Trigger(),267 bootstrap: new FormValidation.plugins.Bootstrap()268 }269 }270 ));271 }272 return {273 // public functions274 init: function () {275 _wizardEl = KTUtil.getById('kt_wizard_v2');276 _formEl = KTUtil.getById('kt_form');277 initWizard();278 initValidation();279 }280 };281}();282jQuery(document).ready(function () {283 KTWizard2.init();...

Full Screen

Full Screen

wizard-2.min.js

Source:wizard-2.min.js Github

copy

Full Screen

1"use strict";2// Class definition3var KTWizard2 = function () {4 // Base elements5 var _wizardEl;6 var _formEl;7 var _wizard;8 var _validations = [];9 // Private functions10 var initWizard = function () {11 // Initialize form wizard12 _wizard = new KTWizard(_wizardEl, {13 startStep: 1, // initial active step number14 clickableSteps: false // to make steps clickable this set value true and add data-wizard-clickable="true" in HTML for class="wizard" element15 });16 // Validation before going to next page17 _wizard.on('beforeNext', function (wizard) {18 // Don't go to the next step yet19 _wizard.stop();20 // Validate form21 var validator = _validations[wizard.getStep() - 1]; // get validator for currnt step22 validator.validate().then(function (status) {23 if (status == 'Valid') {24 _wizard.goNext();25 KTUtil.scrollTop();26 } else {27 Swal.fire({28 text: "Sorry, looks like there are some errors detected, please try again.",29 icon: "error",30 buttonsStyling: false,31 confirmButtonText: "Ok, got it!",32 customClass: {33 confirmButton: "btn font-weight-bold btn-light"34 }35 }).then(function () {36 KTUtil.scrollTop();37 });38 }39 });40 });41 // Change event42 _wizard.on('change', function (wizard) {43 KTUtil.scrollTop();44 });45 }46 var initValidation = function () {47 // Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/48 // Step 149 _validations.push(FormValidation.formValidation(50 _formEl,51 {52 fields: {53 fname: {54 validators: {55 notEmpty: {56 message: 'First name is required'57 }58 }59 },60 lname: {61 validators: {62 notEmpty: {63 message: 'Last Name is required'64 }65 }66 },67 phone: {68 validators: {69 notEmpty: {70 message: 'Phone is required'71 }72 }73 },74 email: {75 validators: {76 notEmpty: {77 message: 'Email is required'78 },79 emailAddress: {80 message: 'The value is not a valid email address'81 }82 }83 }84 },85 plugins: {86 trigger: new FormValidation.plugins.Trigger(),87 bootstrap: new FormValidation.plugins.Bootstrap()88 }89 }90 ));91 // Step 292 _validations.push(FormValidation.formValidation(93 _formEl,94 {95 fields: {96 address1: {97 validators: {98 notEmpty: {99 message: 'Address is required'100 }101 }102 },103 postcode: {104 validators: {105 notEmpty: {106 message: 'Postcode is required'107 }108 }109 },110 city: {111 validators: {112 notEmpty: {113 message: 'City is required'114 }115 }116 },117 state: {118 validators: {119 notEmpty: {120 message: 'State is required'121 }122 }123 },124 country: {125 validators: {126 notEmpty: {127 message: 'Country is required'128 }129 }130 }131 },132 plugins: {133 trigger: new FormValidation.plugins.Trigger(),134 bootstrap: new FormValidation.plugins.Bootstrap()135 }136 }137 ));138 // Step 3139 _validations.push(FormValidation.formValidation(140 _formEl,141 {142 fields: {143 delivery: {144 validators: {145 notEmpty: {146 message: 'Delivery type is required'147 }148 }149 },150 packaging: {151 validators: {152 notEmpty: {153 message: 'Packaging type is required'154 }155 }156 },157 preferreddelivery: {158 validators: {159 notEmpty: {160 message: 'Preferred delivery window is required'161 }162 }163 }164 },165 plugins: {166 trigger: new FormValidation.plugins.Trigger(),167 bootstrap: new FormValidation.plugins.Bootstrap()168 }169 }170 ));171 // Step 4172 _validations.push(FormValidation.formValidation(173 _formEl,174 {175 fields: {176 locaddress1: {177 validators: {178 notEmpty: {179 message: 'Address is required'180 }181 }182 },183 locpostcode: {184 validators: {185 notEmpty: {186 message: 'Postcode is required'187 }188 }189 },190 loccity: {191 validators: {192 notEmpty: {193 message: 'City is required'194 }195 }196 },197 locstate: {198 validators: {199 notEmpty: {200 message: 'State is required'201 }202 }203 },204 loccountry: {205 validators: {206 notEmpty: {207 message: 'Country is required'208 }209 }210 }211 },212 plugins: {213 trigger: new FormValidation.plugins.Trigger(),214 bootstrap: new FormValidation.plugins.Bootstrap()215 }216 }217 ));218 // Step 5219 _validations.push(FormValidation.formValidation(220 _formEl,221 {222 fields: {223 ccname: {224 validators: {225 notEmpty: {226 message: 'Credit card name is required'227 }228 }229 },230 ccnumber: {231 validators: {232 notEmpty: {233 message: 'Credit card number is required'234 },235 creditCard: {236 message: 'The credit card number is not valid'237 }238 }239 },240 ccmonth: {241 validators: {242 notEmpty: {243 message: 'Credit card month is required'244 }245 }246 },247 ccyear: {248 validators: {249 notEmpty: {250 message: 'Credit card year is required'251 }252 }253 },254 cccvv: {255 validators: {256 notEmpty: {257 message: 'Credit card CVV is required'258 },259 digits: {260 message: 'The CVV value is not valid. Only numbers is allowed'261 }262 }263 }264 },265 plugins: {266 trigger: new FormValidation.plugins.Trigger(),267 bootstrap: new FormValidation.plugins.Bootstrap()268 }269 }270 ));271 }272 return {273 // public functions274 init: function () {275 _wizardEl = KTUtil.getById('kt_wizard_v2');276 _formEl = KTUtil.getById('kt_form');277 initWizard();278 initValidation();279 }280 };281}();282jQuery(document).ready(function () {283 KTWizard2.init();...

Full Screen

Full Screen

model.instrumento.js

Source:model.instrumento.js Github

copy

Full Screen

1/**2 * Created by leonardoribeiro on 11/3/16.3 */4"use strict";5module.exports = (sequelize, DataType) => {6 var instrumento = sequelize.define('instrumento', {7 ins_cod:{8 type:DataType.INTEGER,9 primaryKey:true,10 autoIncrement:true11 },12 ins_prcod:{13 type:DataType.INTEGER,14 allowNull:false,15 validate:{16 notEmpty:true17 }18 },19 ins_prsdcond:{20 type:DataType.INTEGER,21 allowNull:true,22 validate:{23 notEmpty:false24 }25 },26 ins_pecod:{27 type:DataType.INTEGER,28 allowNull:false,29 validate:{30 notEmpty:true31 }32 },33 ins_prdescricao:{34 type:DataType.STRING,35 allowNull:false,36 validate:{37 notEmpty:true38 }39 },40 ins_prdtinc:{41 type:DataType.DATE,42 allowNull:false,43 validate:{44 notEmpty:true45 }46 },47 ins_prativo:{48 type:DataType.INTEGER,49 allowNull:false,50 validate:{51 notEmpty:true52 }53 },54 ins_localservico:{55 type:DataType.STRING,56 allowNull:false,57 validate:{58 notEmpty:true59 }60 },61 ins_tag:{62 type:DataType.STRING,63 allowNull:false,64 validate:{65 notEmpty:true66 }67 },68 ins_nro_serie:{69 type:DataType.STRING,70 allowNull:false,71 validate:{72 notEmpty:true73 }74 },75 ins_periodicidade:{76 type:DataType.INTEGER,77 allowNull:false,78 validate:{79 notEmpty:true80 }81 },82 ins_dtult:{83 type:DataType.DATEONLY,84 allowNull:false,85 validate:{86 notEmpty:true87 }88 },89 ins_dtprox_calibracao:{90 type:DataType.DATEONLY,91 allowNull:false,92 validate:{93 notEmpty:true94 }95 },96 ins_nro_certificacao:{97 type:DataType.STRING,98 allowNull:false,99 validate:{100 notEmpty:true101 }102 },103 ins_observacao:{104 type:DataType.STRING,105 allowNull:false,106 validate:{107 notEmpty:true108 }109 },110 ins_marca:{111 type:DataType.STRING,112 allowNull:false,113 validate:{114 notEmpty:true115 }116 },117 ins_dtinc:{118 type:DataType.DATE,119 allowNull:false,120 validate:{121 notEmpty:true122 }123 },124 ins_dtalt:{125 type:DataType.DATE,126 allowNull:false,127 validate:{128 notEmpty:true129 }130 },131 ins_usuario:{132 type:DataType.STRING,133 allowNull:false,134 validate:{135 notEmpty:true136 }137 },138 ins_codinterno:{139 type:DataType.STRING,140 allowNull:false,141 validate:{142 notEmpty:true143 }144 },145 ins_compdescricao:{146 type:DataType.STRING,147 allowNull:false,148 validate:{149 notEmpty:true150 }151 },152 ins_localizacao:{153 type:DataType.STRING,154 allowNull:false,155 validate:{156 notEmpty:true157 }158 },159 ins_modelo:{160 type:DataType.STRING,161 allowNull:false,162 validate:{163 notEmpty:true164 }165 },166 ins_setor:{167 type:DataType.STRING,168 allowNull:false,169 validate:{170 notEmpty:true171 }172 },173 ins_pontos:{174 type:DataType.STRING,175 allowNull:false,176 validate:{177 notEmpty:true178 }179 },180 ins_resolucao:{181 type:DataType.STRING,182 allowNull:false,183 validate:{184 notEmpty:true185 }186 },187 ins_aceitacao:{188 type:DataType.STRING,189 allowNull:false,190 validate:{191 notEmpty:true192 }193 },194 ins_tolerancia:{195 type:DataType.STRING,196 allowNull:false,197 validate:{198 notEmpty:true199 }200 }201 },{202 timestamps: false203 });204 return instrumento;...

Full Screen

Full Screen

unique.routes.js

Source:unique.routes.js Github

copy

Full Screen

...5const authAdmin = require('../middleware/authAdmin');6const authAdminSeller = require('../middleware/authAdminSeller');7const Admin = require('../controllers/AdminSeller')8router.post('/login', [9 check('user', 'Ingresar un usuario Correcto').notEmpty(),10 check('password', ' Campo Vacio. Contraseña').notEmpty(),11 check('password', 'la contraseña debe tener un mínimo de 8 caracteres').isLength({ min: 8 })12], Admin.login)13router.post('/regadmin', [14 check('fullname', 'Campo Nombre del Vendedor Vacio').notEmpty(),15 check('dni', 'Ingresar un dni Correcto').notEmpty(),16 check('dni', 'Ingresar un dni Correcto').isLength({ max: 8 }),17 check('address', 'Campo direccion Vacio').notEmpty(),18 check('celphone', 'Campo celular Vacio').notEmpty(),19 check('email', 'Campo email Vacio').notEmpty(),20 check('email', 'Campo email Vacio').isEmail(),21 check('user', 'Ingresar un usuario Correcto').notEmpty(),22 check('password', ' Campo Vacio. Contraseña').notEmpty(),23 check('password', 'la contraseña debe tener un mínimo de 8 caracteres').isLength({ min: 8 })24], authAdmin('admin'), Admin.CreateAdmin)25router.post('/regseller', [26 check('fullname', 'Campo Nombre del Vendedor Vacio').notEmpty(),27 check('dni', 'Ingresar un dni Correcto').notEmpty(),28 check('dni', 'Ingresar un dni Correcto').isLength({ max: 8 }),29 check('address', 'Campo direccion Vacio').notEmpty(),30 check('celphone', 'Campo celular Vacio').notEmpty(),31 check('email', 'Campo email Vacio').notEmpty(),32 check('email', 'Campo email Vacio').isEmail(),33 check('user', 'Ingresar un usuario Correcto').notEmpty(),34 check('password', ' Campo Vacio. Contraseña').notEmpty(),35 check('password', 'la contraseña debe tener un mínimo de 8 caracteres').isLength({ min: 8 })36], authAdmin('admin'), Admin.CreateSeller)37router.post('/regsales', [38 check('fullname', 'Campo Nombre del Vendedor Vacio').notEmpty(),39 check('creditLine', 'Campo lineaCredito Vació').notEmpty(),40 check('typeOperation', 'Ingresar un tipOperacion Correcto').notEmpty(),41 check('newClient', 'Campo clienteNuevo Vacio').notEmpty(),42 check('typeClient', 'Campo Tipo de Cliente Vacio').notEmpty(),43 check('nameClient', 'Campo nombreCliente Vacio').notEmpty(),44 check('dniClient', 'Campo dniCliente Vacio').notEmpty(),45 check('celphoneClient', 'Ingresar un celularCliente Correcto').notEmpty(),46 check('amountApproved', 'Campo Vacio. montoAprobado').notEmpty(),47 check('quotaAmount', ' Campo Vacio. cantidadCuota').notEmpty(),48 check('quantityQuotas', ' Campo Vacio. montoCuota').notEmpty(),49], authAdminSeller(['admin', 'seller']), Admin.CreateSales)50router.use(formData.parse());51router.post('/regsales/:id/sendpdf', Admin.SendGmailer)52router.get('/allsales', authAdminSeller(['admin', 'seller']), Admin.getSalesAdmin)53router.get('/montosales', authAdminSeller(['admin', 'seller']), Admin.MontoSales)54router.get('/allseller', authAdmin('admin'), Admin.getSellerAdmin)55router.get('/montosalesone/:id', authAdmin('admin'), Admin.getMontoSales)56router.put('/salesupdate/:id', authAdmin('admin'), Admin.PutSales)57router.put('/salesdisenable/:id', authAdmin('admin'), Admin.SalesDis)58router.put('/salesenable/:id', authAdmin('admin'), Admin.SalesEn)59router.put('/sellerupdate/:id', authAdmin('admin'), Admin.PutSeller)60router.put('/sellerdisenable/:id', authAdmin('admin'), Admin.SellerDis)61router.put('/sellerenable/:id', authAdmin('admin'), Admin.SellerEn)62router.get('/logout', authAdminSeller(['admin', 'seller']), Admin.Logout)...

Full Screen

Full Screen

middlewares.js

Source:middlewares.js Github

copy

Full Screen

...5exports.validateCandidatesSignup = () => {6 return [7 check('email').isEmail(),8 check('password').isLength({ min: 6 }),9 check('firstName').notEmpty(),10 check('lastName').notEmpty(),11 check('contactNumber').notEmpty(),12 check('gender').notEmpty(),13 check('dob').notEmpty(),14 check('zip').notEmpty(),15 ];16};17exports.validateEmployersSignup = () => {18 return [19 check("email").isEmail(),20 check("password").isLength({ min: 6 }),21 check("firstName").notEmpty(),22 check("lastName").notEmpty(),23 check("contactNumber").notEmpty(),24 check("gender").notEmpty()25 ];26};27exports.validateCandidatesProfileUpdate = () => {28 return [29 check('image').notEmpty(),30 check('spokenLanguages').isArray(),31 check('github').notEmpty(),32 check('githubImage').notEmpty(),33 check('resume').notEmpty(),34 ];35};36exports.validateCandidatesEducation = () => {37 return [38 check('schoolOrCollege').notEmpty(),39 check('classOrDegree').notEmpty(),40 check('grade').notEmpty(),41 check('from').notEmpty(),42 check('to').notEmpty(),43 ];44};45exports.validateCandidatesExperience = () => {46 return [47 check('companyName').notEmpty(),48 check('designation').notEmpty(),49 check('location').notEmpty(),50 check('joiningDate').notEmpty(),51 check('leavingDate').notEmpty(),52 ];53};54exports.validateCompany = () => {55 return [56 check('establishmentDate').notEmpty(),57 check('companyName').notEmpty(),58 check('companyWebsiteUrl').notEmpty(),59 check('companyLogo').notEmpty(),60 check('founder').notEmpty(),61 check('foundersView').notEmpty(),62 check('aboutCompany').notEmpty(),63 ];...

Full Screen

Full Screen

validation.js

Source:validation.js Github

copy

Full Screen

1const { check } = require("express-validator")2const ContactValidation = [3 check('email').isEmail(),4 check("name", "name is required").notEmpty(),5 check("orgname", "Organisation Name is required").notEmpty(),6 check("subject", "subject is required").notEmpty(),7 check("email", "email is required").notEmpty(),8 check("description", "description is required").notEmpty(),9 check("name", "name should be atmost 50 charaters long").isLength({ max: 50 })10]11const LoginValidator = [12 check("password", "password is required").notEmpty(),13 check("email", "email is required").notEmpty(),14 check("email", "Invalid email address").isEmail(),15]16const OrganizationValidation = [17 check("name", "name is required").notEmpty(),18 check("name", "name should be atmost 50 charaters long").isLength({ max: 50 })19]20const OrgContactValidation = [21 check("name", "name is required").notEmpty(),22 check("OrgID", "OrganizationID is required").notEmpty(),23 check("description", "description is required").notEmpty(),24 check("name", "name should be atmost 50 charaters long").isLength({ max: 50 }),25 check('email').isEmail(),26 check("email", "email is required").notEmpty(),27]28const RegisterValidator = [29 check("name", "Name is required").notEmpty(),30 check("email", "email is required").notEmpty(),31 check("email", "Invalid email address").isEmail(),32 check("password", "password is required").notEmpty(),33]...

Full Screen

Full Screen

Jest Testing Tutorial

LambdaTest’s Jest Testing Tutorial covers step-by-step guides around Jest with code examples to help you be proficient with the Jest framework. The Jest tutorial has chapters to help you learn right from the basics of Jest framework to code-based tutorials around testing react apps with Jest, perform snapshot testing, import ES modules and more.

Chapters

  1. What is Jest Framework
  2. Advantages of Jest - Jest has 3,898,000 GitHub repositories, as mentioned on its official website. Learn what makes Jest special and why Jest has gained popularity among the testing and developer community.
  3. Jest Installation - All the prerequisites and set up steps needed to help you start Jest automation testing.
  4. Using Jest with NodeJS Project - Learn how to leverage Jest framework to automate testing using a NodeJS Project.
  5. Writing First Test for Jest Framework - Get started with code-based tutorial to help you write and execute your first Jest framework testing script.
  6. Jest Vocabulary - Learn the industry renowned and official jargons of the Jest framework by digging deep into the Jest vocabulary.
  7. Unit Testing with Jest - Step-by-step tutorial to help you execute unit testing with Jest framework.
  8. Jest Basics - Learn about the most pivotal and basic features which makes Jest special.
  9. Jest Parameterized Tests - Avoid code duplication and fasten automation testing with Jest using parameterized tests. Parameterization allows you to trigger the same test scenario over different test configurations by incorporating parameters.
  10. Jest Matchers - Enforce assertions better with the help of matchers. Matchers help you compare the actual output with the expected one. Here is an example to see if the object is acquired from the correct class or not. -

|<p>it('check_object_of_Car', () => {</p><p> expect(newCar()).toBeInstanceOf(Car);</p><p> });</p>| | :- |

  1. Jest Hooks: Setup and Teardown - Learn how to set up conditions which needs to be followed by the test execution and incorporate a tear down function to free resources after the execution is complete.
  2. Jest Code Coverage - Unsure there is no code left unchecked in your application. Jest gives a specific flag called --coverage to help you generate code coverage.
  3. HTML Report Generation - Learn how to create a comprehensive HTML report based on your Jest test execution.
  4. Testing React app using Jest Framework - Learn how to test your react web-application with Jest framework in this detailed Jest tutorial.
  5. Test using LambdaTest cloud Selenium Grid - Run your Jest testing script over LambdaTest cloud-based platform and leverage parallel testing to help trim down your test execution time.
  6. Snapshot Testing for React Front Ends - Capture screenshots of your react based web-application and compare them automatically for visual anomalies with the help of Jest tutorial.
  7. Bonus: Import ES modules with Jest - ES modules are also known as ECMAScript modules. Learn how to best use them by importing in your Jest testing scripts.
  8. Jest vs Mocha vs Jasmine - Learn the key differences between the most popular JavaScript-based testing frameworks i.e. Jest, Mocha, and Jasmine.
  9. Jest FAQs(Frequently Asked Questions) - Explore the most commonly asked questions around Jest framework, with their answers.

Run Jest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful