JezK
Edit File: warehousevalidations.js
function addWareHouseValid() { var err = j = 0; console.log(err); var ckValue = editor.getData(); document.getElementById('description').value = ckValue; let wareHouseName = document.getElementById('wareHouseName').value; let wareHouseNumber = document.getElementById('wareHouseNumber').value; let description = document.getElementById('description').value; let city = document.getElementById('city').value; let country = document.getElementById('country').value; let address = document.getElementById('address').value; let phoneNumber = document.getElementById('phoneNumber').value; let location = document.getElementById('location').value; let productDeallenght = jQuery('input[name="productwareHouseDeals[]"]:checked').length; let servicetDealslenght = jQuery('input[name="wareHouseService[]"]:checked').length; let featureDealslenght = jQuery('input[name="wareHousefeature[]"]:checked').length; let spaceDealslenght = jQuery('input[name="wareHouseSpace[]"]:checked').length; let workwith = jQuery('.workwith:checked').length; let dealsOrglength = jQuery('#dealsOrglength').val(); let serviceOrglength = jQuery('#serviceOrglength').val(); let fetureslength = jQuery('#fetureslength').val(); let spacelength = jQuery('#spacelength').val(); let prdDeal = document.getElementById("prdDeal"); let serviceDeal = document.getElementById("serviceDeal"); let feature = document.getElementById("feature"); let space = document.getElementById("space"); // let whWorkWith=jQuery('input[name="workwith[]"]:checked').length; // return true; jQuery('.error').html(''); if (wareHouseName == '') { jQuery('.wareHouseName_error').html(reqField); jQuery('#wareHouseName').focus(); jQuery('#collapseTwo').removeClass("show"); jQuery('#collapseTwo').addClass("show"); jQuery('#collapseTwo').scrollTop(); return false; } /*else if (wareHouseNumber == '') { jQuery('.wareHouseNumber_error').html('Required Field'); jQuery('#wareHouseNumber').focus(); jQuery('#collapseTwo').removeClass("show"); jQuery('#collapseTwo').addClass("show"); jQuery('#collapseTwo').scrollTop(); return false; }*/ else if (description == '') { jQuery('.description_error').html(reqField); jQuery('#description').focus(); jQuery('#collapseTwo').removeClass("show"); jQuery('#collapseTwo').addClass("show"); jQuery('#collapseTwo').scrollTop(); document.getElementById("collapseTwo").scrollIntoView({ behavior: "smooth" }); return false; } else if (city == '') { jQuery('.city_error').html(reqField); jQuery('#city').focus(); jQuery('#warehouseAddress').removeClass("show"); jQuery('#warehouseAddress').addClass("show"); jQuery('#warehouseAddress').scrollTop(); document.getElementById("headingTwo").scrollIntoView({ behavior: "smooth" }); return false; } else if (country == '') { jQuery('.country_error').html(reqField); jQuery('#country').focus(); jQuery('#warehouseAddress').removeClass("show"); jQuery('#warehouseAddress').addClass("show"); jQuery('#warehouseAddress').scrollTop(); document.getElementById("headingTwo").scrollIntoView({ behavior: "smooth" }); return false; } else if (address == '') { jQuery('.address_error').html(reqField); jQuery('#address').focus(); jQuery('#warehouseAddress').removeClass("show"); jQuery('#warehouseAddress').addClass("show"); jQuery('#warehouseAddress').scrollTop(); document.getElementById("headingTwo").scrollIntoView({ behavior: "smooth" }); return false; } else if (phoneNumber == '') { jQuery('.phoneNumber_error').html(reqField); jQuery('#phoneNumber').focus(); jQuery('#warehouseAddress').removeClass("show"); jQuery('#warehouseAddress').addClass("show"); jQuery('#warehouseAddress').scrollTop(); document.getElementById("headingTwo").scrollIntoView({ behavior: "smooth" }); return false; } else if (location == '') { jQuery('.location_error').html(reqField); jQuery('#location').focus(); jQuery('#warehouseAddress').removeClass("show"); jQuery('#warehouseAddress').addClass("show"); document.getElementById("headingTwo").scrollIntoView({ behavior: "smooth" }); jQuery('#warehouseAddress').scrollTop(); return false; } else if (productDeallenght == 0) { jQuery('.deal_error').html(seleMinOneProd); jQuery('#productDealWith').removeClass("show"); jQuery('#productDealWith').addClass("show"); //~ jQuery('#productDealWith').scrollTop(); document.getElementById("headingThree").scrollIntoView({ behavior: "smooth" }); return false; } else if (prdDeal.checked == true && dealsOrglength > productDeallenght) { jQuery('.deal_error').html(youSeleAllBut); jQuery('#productDealWith').removeClass("show"); jQuery('#productDealWith').addClass("show"); //~ jQuery('#productDealWith').scrollTop(); document.getElementById("productDealWith").scrollIntoView({ behavior: "smooth" }); return false; } else if (servicetDealslenght == 0) { jQuery('.service_error').html('Select minimum one Services'); jQuery('#warehouseServices').removeClass("show"); jQuery('#warehouseServices').addClass("show"); //~ jQuery('#warehouseServices').scrollTop(); document.getElementById("headingFour").scrollIntoView({ behavior: "smooth" }); return false; } else if (serviceDeal.checked == true && serviceOrglength > servicetDealslenght) { jQuery('.service_error').html(youSeleAllBut); jQuery('#warehouseServices').removeClass("show"); jQuery('#warehouseServices').addClass("show"); //~ jQuery('#warehouseServices').scrollTop(); document.getElementById("headingFour").scrollIntoView({ behavior: "smooth" }); return false; } else if (featureDealslenght == 0) { jQuery('.fetures_error').html(selMinFeauture); jQuery('#warehouseFeatures').removeClass("show"); jQuery('#warehouseFeatures').addClass("show"); //~ jQuery('#warehouseFeatures').scrollTop(); document.getElementById("headingFour").scrollIntoView({ behavior: "smooth" }); return false; } else if (feature.checked == true && fetureslength > featureDealslenght) { jQuery('.fetures_error').html(youSeleAllBut); jQuery('#warehouseFeatures').removeClass("show"); jQuery('#warehouseFeatures').addClass("show"); //~ jQuery('#warehouseFeatures').scrollTop(); document.getElementById("headingFive").scrollIntoView({ behavior: "smooth" }); return false; } else if (spaceDealslenght == 0) { jQuery('.space_error').html(selMinSpace); jQuery('#warehouseSpace').removeClass("show"); jQuery('#warehouseSpace').addClass("show"); //~ jQuery('#warehouseSpace').scrollTop(); document.getElementById("headingEleven").scrollIntoView({ behavior: "smooth" }); return false; } // else if (space.checked == true && spacelength > spaceDealslenght) { // jQuery('.space_error').html('You selected All but skipped some uncheck'); // jQuery('#warehouseSpace').removeClass("show"); // jQuery('#warehouseSpace').addClass("show"); // //~ jQuery('#warehouseSpace').scrollTop(); // document.getElementById("headingEleven").scrollIntoView({ behavior: "smooth" }); // return false; // } else if (workwith == 0) { jQuery('.workwith_error').html(pleSelAnyWork); jQuery('#workWith').removeClass("show"); jQuery('#workWith').addClass("show"); jQuery('#workWith').scrollTop(); document.getElementById("headingEight").scrollIntoView({ behavior: "smooth" }); return false; } // else // { // let warehouseNum = document.getElementById('warHouseNum').value; // alert(warehouseNum) // } // console.log(err,'err') jQuery(".time_req").each(function() { if ((jQuery('#start_time' + j).val() == '' || jQuery('#end_time' + j).val() == '') && j != 4) { jQuery('.dtst' + j).html(''); jQuery('.dten' + j).html(''); if (jQuery('#start_time' + j).val() == '') { jQuery('.dtst' + j).html(reqField); console.log('.dtst' + j) } if (jQuery('#end_time' + j).val() == '') { jQuery('.dten' + j).html(reqField); console.log('.dten' + j) } err++; } else if ((jQuery('#start_time' + j).val() > jQuery('#end_time' + j).val()) && j != 4) { jQuery('.dten' + j).html(''); jQuery('.dten').focus(); //jQuery('.dten' + j).html('End time should not less than start time'); console.log('.dten' + j) alert(endTimeGreter) err++; } j++; }); // alert() console.log(err,'err') // return true; if (err>1) { // jQuery('#warehouseWorkingHours').removeClass("show"); // jQuery('#warehouseWorkingHours').addClass("show"); // jQuery('#warehouseWorkingHours').scrollTop(); return false; } return true; } function editwhpriceValid() { // alert(0) // let removedPallets = document.getElementById("removedPallets").value; // alert(removedPallets); // return false; let wareHousePriceTypeLength = jQuery('input[name="wareHousePriceType[]"]:checked').length; let wareHouseOrgTypes = jQuery('#wareHouseOrgTypes').val(); let pricetype = document.getElementById("pricetype"); let pricTy2 = document.getElementById("pricTy1"); let pricTy3 = document.getElementById("pricTy2"); let warehousePackageType = jQuery('input[name="warehousePackageType"]:checked').length; let maxstorageWeight = document.getElementById("maxstorageWeight") ? document.getElementById("maxstorageWeight").value : ""; let maxstorageHeight = document.getElementById("maxstorageHeight") ? document.getElementById("maxstorageHeight").value : ""; let wareHousepayment_types = jQuery('input[name="payment_types[]"]:checked').length; let max_pallet_online_booking = document.getElementById("max_pallet_online_booking").value; /*alert(maxstorageWeight); alert(maxstorageHeight);*/ let j = k = 0; let err = 0; jQuery('.error').html(''); //~ if (maxstorageWeight == "") { //~ //alert(1); //~ jQuery('.maxstorageWeight_error').html('Required field.'); //~ jQuery('#maxstorageWeight').focus(); //~ jQuery('#partnerType').removeClass("show"); //~ jQuery('#partnerType').addClass("show"); //~ jQuery('#partnerType').scrollTop(); //~ return false; //~ } //~ if (maxstorageHeight == "") { //~ //alert(2); //~ jQuery('.maxstorageHeight_error').html('Required field.'); //~ jQuery('#maxstorageHeight').focus(); //~ jQuery('#partnerType').removeClass("show"); //~ jQuery('#partnerType').addClass("show"); //~ jQuery('#partnerType').scrollTop(); //~ return false; //~ } //~ alert(3) // alert(pricTy2.checked) //~ if (wareHousepayment_types == 0) { //~ alert(1) //~ jQuery('.paymentType_error').html('Select warehouse payment type'); //~ jQuery('#payment').removeClass("show"); //~ jQuery('#payment').addClass("show"); //~ jQuery('#payment').scrollTop(); //~ return false; //~ } //~ if (max_pallet_online_booking == 0) { //~ alert(2) //~ jQuery('.max_pallet_online_booking_error').html('Select warehouse payment type'); //~ jQuery('#max_pallet_online_booking').focus(); //~ jQuery('#payment').removeClass("show"); //~ jQuery('#payment').addClass("show"); //~ jQuery('#payment').scrollTop(); //~ return false; //~ } if (wareHousePriceTypeLength == 0) { jQuery('.wareHouseTypes_error').html(selMinPri); jQuery('#warehouseprice').removeClass("show"); jQuery('#warehouseprice').addClass("show"); jQuery('#warehouseprice').scrollTop(); return false; } //~ else if (pricetype.checked == true && wareHouseOrgTypes > wareHousePriceTypeLength) { //~ alert(4) //~ jQuery('.wareHouseTypes_error').html('You selected All but skipped some uncheck'); //~ jQuery('#warehouseprice').removeClass("show"); //~ jQuery('#warehouseprice').addClass("show"); //~ jQuery('#warehouseprice').scrollTop(); //~ return false; //~ } else if (pricTy2.checked == true || pricTy3.checked == true) { //~ alert(5) let today = new Date(); if (pricTy2.checked == true) { //~ alert() jQuery(".time_req1").each(function() { jQuery('.minp' + j).html(''); jQuery('.minpp' + j).html(''); jQuery('.maxp' + j).html(''); jQuery('.maxpp' + j).html(''); jQuery('.ppfrm' + j).html(''); jQuery('.ppto' + j).html(''); jQuery('.ppday' + j).html(''); if (jQuery('#minPallet' + j).val() == '') { jQuery('.minp' + j).html(reqField); err++; } if (jQuery('#minPalletPeriod' + j).val() == '') { jQuery('.minpp' + j).html(reqField); err++; } if (jQuery('#maxPallet' + j).val() == '') { jQuery('.maxp' + j).html(reqField); err++; } if (jQuery('#maxPalletPeriod' + j).val() == '') { jQuery('.maxpp' + j).html(reqField); err++; } if (jQuery('#palletDateFrom' + j).val() == '') { jQuery('.ppfrm' + j).html(reqField); err++; } if (jQuery('#palletDateTo' + j).val() == '') { jQuery('.ppto' + j).html(reqField); err++; } if (jQuery('#palletPricePday' + j).val() == '') { jQuery('.ppday' + j).html(reqField); err++; } if (jQuery('#minPallet' + j).val() == '') { jQuery('.minp' + j).html(reqField); err++; } if (jQuery('#maxPalletPeriod' + j).val() == '') { jQuery('.ppto0' + j).html(reqField); err++; } //~ alert(6) var minPallet = parseInt(jQuery('#minPallet' + j).val()); var maxPallet = parseInt(jQuery('#maxPallet' + j).val()); //~ alert(minPallet) //~ alert(maxPallet) if (minPallet != '' && maxPallet != '' && minPallet > maxPallet) { jQuery('.maxp' + j).html(maxpalletLess); err++; } //~ return; var minPalletPeriod = parseInt(jQuery('#minPalletPeriod' + j).val()); var maxPalletPeriod = parseInt(jQuery('#maxPalletPeriod' + j).val()); if ( minPalletPeriod != '' && maxPalletPeriod != '' && minPalletPeriod > maxPalletPeriod) { jQuery('.maxpp' + j).html(maxPalletPer); err++; } if (typeof(jQuery('#palletDateFrom' + j).val()) != "undefined" && typeof(jQuery('#palletDateTo' + j).val()) != "undefined" && jQuery('#palletDateFrom' + j).val() != '' && jQuery('#palletDateTo' + j).val() != '') { if (Date.parse(dateConv(jQuery('#palletDateFrom' + j).val())) > Date.parse(dateConv(jQuery('#palletDateTo' + j).val()))) { jQuery('.ppto' + j).html(palletPeriodShould); err++; } } j++; }); if (err) { jQuery('#palletDetails').removeClass("show"); jQuery('#palletDetails').addClass("show"); jQuery('#palletDetails').scrollTop(); return false; } //~ return false; } if (pricTy3.checked == true) { jQuery(".time_req2").each(function() { jQuery('.mins' + k).html(''); jQuery('.minps' + k).html(''); jQuery('.maxs' + k).html(''); jQuery('.maxps' + k).html(''); jQuery('.spacefrom_er' + k).html(''); jQuery('.spaceto_er' + k).html(''); jQuery('.spacepday_er' + k).html(''); if (jQuery('#minSpace' + k).val() == '') { jQuery('.mins' + k).html(reqField); err++; } if (jQuery('#minPeriodSpace' + k).val() == '') { jQuery('.minps' + k).html(reqField); err++; } if (jQuery('#maxSpace' + k).val() == '') { jQuery('.maxs' + k).html(reqField); err++; } if (jQuery('#maxPeriodSpace' + k).val() == '') { jQuery('.maxps' + k).html(reqField); err++; } if (jQuery('#spaceFrom' + k).val() == '') { jQuery('.spacefrom_er' + k).html(reqField); err++; } if (jQuery('#spaceTo' + k).val() == '') { jQuery('.spaceto_er' + k).html(reqField); err++; } if (jQuery('#spacePerDay' + k).val() == '') { jQuery('.spacepday_er' + k).html(reqField); err++; } var minSpace = parseInt(jQuery('#minSpace' + k).val()); var maxSpace = parseInt(jQuery('#maxSpace' + k).val()); if (minSpace != '' && maxSpace != '' && minSpace > maxSpace) { jQuery('.maxs' + k).html(maxSpaceNotless); err++; } var minPeriodSpace = parseInt(jQuery('#minPeriodSpace' + k).val()); var maxPeriodSpace = parseInt(jQuery('#maxPeriodSpace' + k).val()); if ( minPeriodSpace != '' && maxPeriodSpace != '' && minPeriodSpace > maxPeriodSpace) { jQuery('.spaceto_er' + k).html(maxSpacePri); err++; } if (typeof(jQuery('#spaceFrom' + k).val()) != "undefined" && typeof(jQuery('#spaceTo' + k).val()) != "undefined" && jQuery('#spaceFrom' + k).val() != '' && jQuery('#spaceTo' + k).val() != '') { if (Date.parse(dateConv(jQuery('#spaceFrom' + k).val())) > Date.parse(dateConv(jQuery('#spaceTo' + k).val()))) { jQuery('.spaceto_er' + k).html(spacePeriod); err++; } } k++; }); if (err) { jQuery('#spaceDetails').removeClass("show"); jQuery('#spaceDetails').addClass("show"); jQuery('#spaceDetails').scrollTop(); return false; } } } else if (warehousePackageType == 0 || warehousePackageType == '') { jQuery('.warehousePackageType_error').html(selWarePackType); jQuery('#partnerType').removeClass("show"); jQuery('#partnerType').addClass("show"); jQuery('#partnerType').scrollTop(); return false; } } function whpriceValid() { let wareHousePriceTypeLength = jQuery('input[name="wareHousePriceType[]"]:checked').length; // alert(wareHousePriceTypeLength); console.log(wareHousePriceTypeLength); let wareHouseOrgTypes = jQuery('#wareHouseOrgTypes').val(); let pricetype = document.getElementById("pricetype"); let pricTy2 = document.getElementById("pricTy2"); let pricTy3 = document.getElementById("pricTy3"); let warehousePackageType = jQuery('input[name="warehousePackageType"]:checked').length; /* let maxstorageWeight = document.getElementById("maxstorageWeight"); let maxstorageHeight = document.getElementById("maxstorageHeight");*/ // let maxstorageWeight = document.getElementById("maxstorageWeight").value; // let maxstorageHeight = document.getElementById("maxstorageHeight").value; let j = k = 0; let err = 0; jQuery('.error').html(''); if (wareHousePriceTypeLength == 0) { //alert("1"); jQuery('.wareHouseTypes_error').html(selMinPri); jQuery('#warehouseprice').removeClass("show"); jQuery('#warehouseprice').addClass("show"); jQuery('#warehouseprice').scrollTop(); return false; } if (pricTy2.checked == true) { // alert("4"); jQuery(".time_req1").each(function() { jQuery('.minp' + j).html(''); jQuery('.minpp' + j).html(''); jQuery('.maxp' + j).html(''); jQuery('.maxpp' + j).html(''); jQuery('.ppfrm' + j).html(''); jQuery('.ppto' + j).html(''); jQuery('.ppday' + j).html(''); if (jQuery('#minPallet' + j).val() == '') { jQuery('.minp' + j).html(reqField); err++; } if (jQuery('#minPalletPeriod' + j).val() == '') { jQuery('.minpp' + j).html(reqField); err++; } if (jQuery('#maxPallet' + j).val() == '') { jQuery('.maxp' + j).html(reqField); err++; } if (jQuery('#maxPalletPeriod' + j).val() == '') { jQuery('.maxpp' + j).html(reqField); err++; } if (jQuery('#palletDateFrom' + j).val() == '') { jQuery('.ppfrm' + j).html(reqField); err++; } if (jQuery('#palletDateTo' + j).val() == '') { jQuery('.ppto' + j).html(reqField); err++; } if (jQuery('#palletPricePday' + j).val() == '') { jQuery('.ppday' + j).html(reqField); err++; } var minPallet = parseInt(jQuery('#minPallet' + j).val()); var maxPallet = parseInt(jQuery('#maxPallet' + j).val()); if (minPallet != '' && maxPallet != '' && minPallet > maxPallet) { jQuery('.maxp' + j).html(maxpalletLess); err++; } var minPalletPeriod = parseInt(jQuery('#minPalletPeriod' + j).val()); var maxPalletPeriod = parseInt(jQuery('#maxPalletPeriod' + j).val()); if ( minPalletPeriod != '' && maxPalletPeriod != '' && minPalletPeriod > maxPalletPeriod) { jQuery('.maxpp' + j).html(maxPalletPer); err++; } if (typeof(jQuery('#palletDateFrom' + j).val()) != "undefined" && typeof(jQuery('#palletDateTo' + j).val()) != "undefined" && jQuery('#palletDateFrom' + j).val() != '' && jQuery('#palletDateTo' + j).val() != '') { if (Date.parse(dateConv(jQuery('#palletDateFrom' + j).val())) > Date.parse(dateConv(jQuery('#palletDateTo' + j).val()))) { jQuery('.ppto' + j).html(palletPeriodShould); err++; } } j++; }); if (err) { jQuery('#palletDetails').removeClass("show"); jQuery('#palletDetails').addClass("show"); jQuery('#palletDetails').scrollTop(); return false; } } if (pricTy3.checked == true) { // alert("5"); jQuery(".time_req2").each(function() { jQuery('.mins' + k).html(''); jQuery('.minps' + k).html(''); jQuery('.maxs' + k).html(''); jQuery('.maxps' + k).html(''); jQuery('.spacefrom_er' + k).html(''); jQuery('.spaceto_er' + k).html(''); jQuery('.spacepday_er' + k).html(''); if (jQuery('#minSpace' + k).val() == '') { jQuery('.mins' + k).html(reqField); err++; } if (jQuery('#minPeriodSpace' + k).val() == '') { jQuery('.minps' + k).html(reqField); err++; } if (jQuery('#maxSpace' + k).val() == '') { jQuery('.maxs' + k).html(reqField); err++; } if (jQuery('#maxPeriodSpace' + k).val() == '') { jQuery('.maxps' + k).html(reqField); err++; } if (jQuery('#spaceFrom' + k).val() == '') { jQuery('.spacefrom_er' + k).html(reqField); err++; } if (jQuery('#spaceTo' + k).val() == '') { jQuery('.spaceto_er' + k).html(reqField); err++; } if (jQuery('#spacePerDay' + k).val() == '') { jQuery('.spacepday_er' + k).html(reqField); err++; } if (jQuery('#minPeriodSpace' + k).val() == '') { jQuery('.minps' + k).html(reqField); err++; } if (jQuery('#maxPeriodSpace' + k).val() == '') { jQuery('.maxps' + k).html(reqField); err++; } var minSpace = parseInt(jQuery('#minSpace' + k).val()); var maxSpace = parseInt(jQuery('#maxSpace' + k).val()); if (minSpace != '' && maxSpace != '' && minSpace > maxSpace) { jQuery('.maxs' + k).html(maxSpaceNotless); err++; } var minPeriodSpace = parseInt(jQuery('#minPeriodSpace' + k).val()); var maxPeriodSpace = parseInt(jQuery('#maxPeriodSpace' + k).val()); if ( minPeriodSpace != '' && maxPeriodSpace != '' && minPeriodSpace > maxPeriodSpace) { jQuery('.maxps' + k).html(maxSpacePri); err++; } if (typeof(jQuery('#spaceFrom' + k).val()) != "undefined" && typeof(jQuery('#spaceTo' + k).val()) != "undefined" && jQuery('#spaceFrom' + k).val() != '' && jQuery('#spaceTo' + k).val() != '') { if (Date.parse(dateConv(jQuery('#spaceFrom' + k).val())) > Date.parse(dateConv(jQuery('#spaceTo' + k).val()))) { jQuery('.spaceto_er' + k).html(spacePeriod); err++; } } k++; }); if (err) { jQuery('#spaceDetails').removeClass("show"); jQuery('#spaceDetails').addClass("show"); jQuery('#spaceDetails').scrollTop(); return false; } } // else if (pricetype.checked == true && wareHouseOrgTypes > wareHousePriceTypeLength) { // // alert("2"); // jQuery('.wareHouseTypes_error').html('You selected All but skipped some uncheck'); // jQuery('#warehouseprice').removeClass("show"); // jQuery('#warehouseprice').addClass("show"); // jQuery('#warehouseprice').scrollTop(); // return false; // } } function whaddinfoValid() { // let warehouseOwnerDetails = jQuery('input[name="warehouseOwnerDetails"]:checked').length; let insuranceDescription = document.getElementById('description2').value; let insuranceAttach = document.getElementById('file1').value; // let whLogo = document.getElementById('fileupload').value; let licenseNumber = document.getElementById('licenseNumber').value; let licenseExpiry = document.getElementById('licenseExpiry').value; let Licensefile = document.getElementById('Licensefile').value; let Legalfile = document.getElementById('Legalfile').value; // let Legalfile1 = document.getElementById('Legalfile1').value; if (insuranceDescription == '') { jQuery('.insuranceDescription_error').html(reqField); jQuery('#description2').focus(); jQuery('#insuranceDetails').removeClass("show"); jQuery('#insuranceDetails').addClass("show"); jQuery('#insuranceDetails').scrollTop(); return false; } else if (insuranceAttach == '') { jQuery('.insurance_attach_error').html(reqField); jQuery('.imageName').focus(); jQuery('#insuranceDetails').removeClass("show"); jQuery('#insuranceDetails').addClass("show"); jQuery('#insuranceDetails').scrollTop(); return false; } // else if (whLogo == '') { // jQuery('.warehouse_logo_error').html('Required Field'); // jQuery('#preview').focus(); // jQuery('#logo').removeClass("show"); // jQuery('#logo').addClass("show"); // jQuery('#logo').scrollTop(); // return false; // } else if (licenseNumber == '') { jQuery('.licenseNumber_error').html(reqField); jQuery('#licenseNumber').focus(); jQuery('#License').removeClass("show"); jQuery('#License').addClass("show"); jQuery('#License').scrollTop(); return false; } else if (licenseExpiry == '') { jQuery('.licenseExpiry_error').html(reqField); jQuery('#licenseExpiry').focus(); jQuery('#License').removeClass("show"); jQuery('#License').addClass("show"); jQuery('#License').scrollTop(); return false; } else if (licenseExpiry == '') { jQuery('.licenseExpiry_error').html(reqField); jQuery('#licenseExpiry').focus(); jQuery('#License').removeClass("show"); jQuery('#License').addClass("show"); jQuery('#License').scrollTop(); return false; } else if (Licensefile == '') { jQuery('.Licensefile_error').html(reqField); jQuery('#Licensefile').focus(); jQuery('#License').removeClass("show"); jQuery('#License').addClass("show"); jQuery('#License').scrollTop(); return false; } else if (Legalfile == '') { jQuery('.Legalfile_error').html(reqField); jQuery('.imagename1').focus(); jQuery('#supported').removeClass("show"); jQuery('#supported').addClass("show"); jQuery('#supported').scrollTop(); return false; } // else if (Legalfile1 == '') { // jQuery('.Legalfile1_error').html('Required Field'); // jQuery('.imagename2').focus(); // jQuery('#supported').removeClass("show"); // jQuery('#supported').addClass("show"); // jQuery('#supported').scrollTop(); // return false; // } } function wheditinfoValid() { // alert(); let warehouseOwnerDetails = jQuery('input[name="warehouseOwnerDetails"]:checked').length; let insuranceDescription = document.getElementById('description2').value; // let insuranceAttach = document.getElementById('file1').value; // let whLogo = document.getElementById('fileupload').value; let licenseNumber = document.getElementById('licenseNumber').value; let licenseExpiry = document.getElementById('licenseExpiry').value; // let Licensefile = document.getElementById('Licensefile').value; // let Legalfile = document.getElementById('Legalfile').value; // let Legalfile1 = document.getElementById('Legalfile1').value; //~ if (warehouseOwnerDetails == 0) { //~ alert(1) //~ jQuery('.wareHouseContactSatus_error').html('select Contact Details status'); //~ jQuery('#Contactdetails').removeClass("show"); //~ jQuery('#Contactdetails').addClass("show"); //~ jQuery('#Contactdetails').scrollTop(); //~ return false; //~ } else if (insuranceDescription == '') { jQuery('.insuranceDescription_error').html(reqField); jQuery('#description2').focus(); jQuery('#insuranceDetails').removeClass("show"); jQuery('#insuranceDetails').addClass("show"); jQuery('#insuranceDetails').scrollTop(); return false; } else if (licenseNumber == '') { jQuery('.licenseNumber_error').html(reqField); jQuery('#licenseNumber').focus(); jQuery('#License').removeClass("show"); jQuery('#License').addClass("show"); jQuery('#License').scrollTop(); return false; } else if (licenseExpiry == '') { jQuery('.licenseExpiry_error').html(reqField); jQuery('#licenseExpiry').focus(); jQuery('#License').removeClass("show"); jQuery('#License').addClass("show"); jQuery('#License').scrollTop(); return false; } // else if (Licensefile == '') { // jQuery('.Licensefile_error').html('Required Field'); // jQuery('#Licensefile').focus(); // jQuery('#License').removeClass("show"); // jQuery('#License').addClass("show"); // jQuery('#License').scrollTop(); // return false; // } else if (Legalfile == '') { // jQuery('.Legalfile_error').html('Required Field'); // jQuery('.imagename1').focus(); // jQuery('#supported').removeClass("show"); // jQuery('#supported').addClass("show"); // jQuery('#supported').scrollTop(); // return false; // } else if (Legalfile1 == '') { // jQuery('.Legalfile1_error').html('Required Field'); // jQuery('.imagename2').focus(); // jQuery('#supported').removeClass("show"); // jQuery('#supported').addClass("show"); // jQuery('#supported').scrollTop(); // return false; // } } function wareHouseNumberplz(recVal) { if (recVal != '') { var receivedData = {}; jQuery.ajax({ type: "POST", url: "ajax.php", data: { "process": "BringWhNum", "data": JSON.stringify(receivedData) }, success: function(data) { if (data.state == "success") { document.getElementById('warHouseNum').value = ''; jQuery('#warHouseNum').val(data.result); } else { // if api.php returns failure, display error } }, error: function(jqXHR, textStatus, errorThrown, data) { // error handling }, dataType: "json" }); } } function dateConv(d) { if (d != "") { var s1 = d; var s2 = s1.split("-"); var convdate = s2[2] + '-' + s2[1] + '-' + s2[0]; //Y-m-d return convdate; } else { return false; } } function checkPhone(e) { var key = e.keyCode || e.charCode; if (key == 13 || key == 43 || (key >= 48 && key <= 57) || key == 8 || key == 46) { return true; } else { return false; } }