اذهب إلى المحتوى

Aisha Zaki

الأعضاء
  • المساهمات

    69
  • تاريخ الانضمام

  • تاريخ آخر زيارة

  • عدد الأيام التي تصدر بها

    1

أجوبة بواسطة Aisha Zaki

  1. السلام عليكم

    احاول جمع وارسال البيانات من نموذج بصفحةhtml بعد التحقق من ادخال البيانات بالحقول باستخدام jquery validation الى google sheet

    وتمكن بطريقة ما من منع  ارسال حقول فارغة الا انني اواجه مشكلة.ففي النموذج يظهر جدول يبين ما تم شراءة من الصفحة وتحديد العدد المطلوب مع امكانية  حذف الطلب، ويفترض انه يمنع ارسال البيانات في حال كان جدول الطلب  فارغا .. الا انه يتم الارسال. حاولت حل المشكلة كتالي:

      serverlessForm.addEventListener('submit', e => {
         //للتاكد من الكمية المختارة ليست صفر
                if ($('[data-product-quantity]').val() === "1" || $('[data-product-quantity]').val()==="2") {
                    console.log($('[data-product-quantity]').val())
                    $('[data-product-quantity]').addClass("success")
                }
    
                //عندما  تصبح الحقول محققة من قبل  jquery vlidation ارسل البيانات ل google  sheet
              if(Name.hasClass("success") 
                && phone.hasClass("success") 
                && address.hasClass("success")
                && $('[data-product-quantity]').hasClass("success") ){
    
                e.preventDefault();
                spinner.show();
    
    
                fetch(scriptURLC, {
                        mode: 'no-cors',
                        method: 'POST',
                        body: new FormData(serverlessForm)
                    })
                    .then(res => {
    
                        console.log(res);
                        spinner.hide();
    
                        
                        swal("تم ارسال طلبك بنجاح!",
                             "سنتواصل معك قريبا.احظى بتسوق ممتع!", "success");
                        modal.modal('hide');
                        serverlessForm.reset();
                        Name.removeClass("success") 
                        phone.removeClass("success") 
                        address.removeClass("success")
                        return true;
                    })
                    .catch(error => {
    
                        swal("حدث خطأ ما!", `ارجو معاودة المحاولة   لاحقا: ${error}`, "error");
                        // todo enable submit button
    
                    })
              }
               
            });

    ولم تعمل، فقمت باستخدام دالة addMethod التابعه لjquery validation ولم تعمل ايضا...

    jQuery.validator.addMethod("orders", function (value, element) {
           var numberOfOrders= $('[data-product-quantity]').val();
           return this.optional(element) || numberOfOrders !=="0";
    
        },'لطفا اختيار العدد المطلوب من فرشاة ايمي')

    كما انه بالشاشات الصغيرة عند تحديد العدد المطلوب يتم حذف المنتج تلقائيا فما السبب

    رابط العمل على github --->  https://github.com/aishazaki/aishazaki-emibrush.github.io

    وشكرا

    • أعجبني 1
  2. بتاريخ On 9‏/6‏/2021 at 16:07 قال محمد أبو عواد:

    حاولي أن تضعي هذا السطر في الكائن module.exports

    
        target: 'node',

    هذا هو الملف بعد التعديل
    webpack.config.js

    ثم قومي بتشغيل الأمر

    
    npm run build

     

    ماذا عن التنبيهات.. فهى تسبب خلل في تنسيقات الصفحه ما الحل؟ 

    WARNING in ./node_modules/browserslist/node.js 161:18-66

    Critical dependency: the request of a dependency is an expression

     @ ./node_modules/browserslist/index.js 8:10-27

     @ ./node_modules/webpack/lib/config/browserslistTargetHandler.js 8:21-44      

     @ ./node_modules/webpack/lib/config/target.js 11:1-39

     @ ./node_modules/webpack/lib/config/defaults.js 16:4-23

     @ ./node_modules/webpack/lib/index.js 328:10-66

     @ ./src/index.js 14:0-35

     

    WARNING in ./node_modules/browserslist/node.js 161:26-33

    Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

     @ ./node_modules/browserslist/index.js 8:10-27

     @ ./node_modules/webpack/lib/config/browserslistTargetHandler.js 8:21-44      

     @ ./node_modules/webpack/lib/config/target.js 11:1-39

     @ ./node_modules/webpack/lib/config/defaults.js 16:4-23

     @ ./node_modules/webpack/lib/index.js 328:10-66

     @ ./src/index.js 14:0-35

     

    WARNING in ./node_modules/browserslist/node.js 181:16-186:5

    Critical dependency: the request of a dependency is an expression

     @ ./node_modules/browserslist/index.js 8:10-27

     @ ./node_modules/webpack/lib/config/browserslistTargetHandler.js 8:21-44      

     @ ./node_modules/webpack/lib/config/target.js 11:1-39

     @ ./node_modules/webpack/lib/config/defaults.js 16:4-23

     @ ./node_modules/webpack/lib/index.js 328:10-66

     @ ./src/index.js 14:0-35

     

    WARNING in ./node_modules/browserslist/node.js 182:6-13

    Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

     @ ./node_modules/browserslist/index.js 8:10-27

     @ ./node_modules/webpack/lib/config/browserslistTargetHandler.js 8:21-44      

     @ ./node_modules/webpack/lib/config/target.js 11:1-39

     @ ./node_modules/webpack/lib/config/defaults.js 16:4-23

     @ ./node_modules/webpack/lib/index.js 328:10-66

     @ ./src/index.js 14:0-35

     

    WARNING in ./node_modules/jest-worker/build/base/BaseWorkerPool.js 119:19-46   

    Critical dependency: the request of a dependency is an expression

     @ ./node_modules/jest-worker/build/WorkerPool.js 8:45-77

     @ ./node_modules/jest-worker/build/index.js 38:41-64

     @ ./node_modules/terser-webpack-plugin/dist/index.js 22:18-40

     @ ./node_modules/terser-webpack-plugin/dist/cjs.js 3:15-33

     @ ./node_modules/webpack/lib/config/defaults.js 952:25-57

     @ ./node_modules/webpack/lib/index.js 328:10-66

     @ ./src/index.js 14:0-35

     

    WARNING in ./node_modules/jest-worker/build/index.js 68:19-38

    Critical dependency: the request of a dependency is an expression

     @ ./node_modules/terser-webpack-plugin/dist/index.js 22:18-40

     @ ./node_modules/terser-webpack-plugin/dist/cjs.js 3:15-33

     @ ./node_modules/webpack/lib/config/defaults.js 952:25-57

     @ ./node_modules/webpack/lib/index.js 328:10-66

     @ ./src/index.js 14:0-35

     

    WARNING in ./node_modules/jest-worker/build/workers/processChild.js 97:15-28   

    Critical dependency: the request of a dependency is an expression

     @ ./node_modules/jest-worker/build/workers/ChildProcessWorker.js 142:6-39     

     @ ./node_modules/jest-worker/build/WorkerPool.js 41:15-62

     @ ./node_modules/jest-worker/build/index.js 38:41-64

     @ ./node_modules/terser-webpack-plugin/dist/index.js 22:18-40

     @ ./node_modules/terser-webpack-plugin/dist/cjs.js 3:15-33

     @ ./node_modules/webpack/lib/config/defaults.js 952:25-57

     @ ./node_modules/webpack/lib/index.js 328:10-66

     @ ./src/index.js 14:0-35

     

    WARNING in ./node_modules/jest-worker/build/workers/processChild.js 113:15-28  

    Critical dependency: the request of a dependency is an expression

     @ ./node_modules/jest-worker/build/workers/ChildProcessWorker.js 142:6-39     

     @ ./node_modules/jest-worker/build/WorkerPool.js 41:15-62

     @ ./node_modules/jest-worker/build/index.js 38:41-64

     @ ./node_modules/terser-webpack-plugin/dist/index.js 22:18-40

     @ ./node_modules/terser-webpack-plugin/dist/cjs.js 3:15-33

     @ ./node_modules/webpack/lib/config/defaults.js 952:25-57

     @ ./node_modules/webpack/lib/index.js 328:10-66

     @ ./src/index.js 14:0-35

     

    WARNING in ./node_modules/loader-runner/lib/loadLoader.js 19:16-36

    Critical dependency: the request of a dependency is an expression

     @ ./node_modules/loader-runner/lib/LoaderRunner.js 7:17-40

     @ ./node_modules/webpack/lib/NormalModule.js 9:35-59

     @ ./node_modules/webpack/lib/index.js 248:9-34

     @ ./src/index.js 14:0-35

     

    WARNING in ./node_modules/terser-webpack-plugin/dist/minify.js 279:118-125     

    Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

     @ ./node_modules/terser-webpack-plugin/dist/index.js 26:14-33 288:31-58       

     @ ./node_modules/terser-webpack-plugin/dist/cjs.js 3:15-33

     @ ./node_modules/webpack/lib/config/defaults.js 952:25-57

     @ ./node_modules/webpack/lib/index.js 328:10-66

     @ ./src/index.js 14:0-35

     

    WARNING in ./node_modules/webpack/lib/serialization/ObjectMiddleware.js 636:9-25

    Critical dependency: the request of a dependency is an expression

     @ ./node_modules/webpack/lib/util/serialization.js 19:1-45

     @ ./node_modules/webpack/lib/index.js 539:10-41

     @ ./src/index.js 14:0-35

     

    11 warnings have detailed information that is not shown.

    Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.       

     

    webpack 5.38.1 compiled with 11 warnings in 91249 ms

  3. ظهر لدي خطأ التالي :

    Webpack <5 used to include polyfills for node. js core modules by default. This is no longer the case. Verity if you need this module and configure apolyfill for it. ويطلب مني اضافه عده قواعد لwebpack. config. js وتنزيل ما يلزمها ك

     crypto-browersify و buffer و https وغيرها 

    او اختيار القيمه  false لجميع القواعد 

    ماذا يجب افعل لحل المشكله وما هو عملpolyfill من الاساس 

    وشكرا 

×
×
  • أضف...