JSFiddle - React, Tailwind, and code Playground

by doctor23

JavaScript

var that            = $('#order-creation__form'),
            ordSave         = that.find('input[name="save"]').val(),
            ordName         = that.find('input[name="BUYER_NAME"]').val(),
            ordTel          = that.find('input[name="BUYER_PHONE"]').val(),
            ordEmail        = that.find('input[name="BUYER_EMAIL"]').val(),
            DTalkCheck      = that.find('input[name="DONT_TALK"]').prop('checked'),
            ForMeCheck      = that.find('input[name="FOR_ME"]').prop('checked'),
            UrselfCheck     = that.find('#deliveryYourself').prop('checked'),
            CourierCheck    = that.find('#deliveryKur').prop('checked'),
            within3h        = that.find('#timeInterval').prop('checked'),
            exTime          = that.find('#time').prop('checked'),
            ordPackCheck    = that.find('#orderPayWrap').prop('checked'),
            ordAttCheck     = that.find('#orderPostal').prop('checked'),
            ordSmsCheck     = that.find('#orderSMS').prop('checked');

            if (ForMeCheck) {
                var ordForMe    = '',
                    ordRecName  = '',
                    ordRecTel   = '',
                    ordRecDesc  = '';

            } else {
                var ordForMe    = ForMeCheck,
                    ordRecName  = that.find('input[name="RECIPIENT_NAME"]').val(),
                    ordRecTel   = that.find('input[name="RECIPIENT_PHONE"]').val(),
                    ordRecDesc  = that.find('textarea[name="user_description"]').val();
            }
            
            if (UrselfCheck) {
                var ordDelvRadio    = UrselfCheck,
                    ordDelvDate     = that.find('input[name="dateDeliveryYourself"]').val(),
                    ordDelvTime     = that.find('.delivery-time_selected input[name="deliv_yoursef"]').val();
            } else {
                var ordDelvRadio    = '',
                    ordDelvDate     = '',
                    ordDelvTime     = '';
           ...