Submit a Ticket

Attach a file

Phone & Live Chat Hours

Monday - Sunday: 9:00 am - 6:00 pm EST

Contact Information

Phone: (801) 953-0070
Fax: (800) 563-2951

Mailing Address

All Filters LLC
2256 S 1250 W
Woods Cross, UT 84087-2515
'); } } function formatBytes(bytes) { var decimals = 2; if (bytes === 0) return '0 Bytes'; const k = 1024; const dm = decimals < 0 ? 0 : decimals; const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; } ClassicEditor.create(document.querySelector('#MessageTextBox'), { toolbar: { items: ["undo", "redo", "|", "bold", "italic", "underline", "|", "bulletedList", "numberedList", "|", "link", "insertTable"] } }).then(editor => { window.editor = editor; }).catch(err => { console.error(err.stack); }); function onTypechange() { var msg = ""; var ticket_type = jQuery("#TicketTypeDropDown").val(); jQuery(".ticket_type_message").remove(); jQuery("#ticket-attachments").html(""); jQuery(".div-Email").show(); jQuery(".div-Message").show(); jQuery(".div-Upload").show(); jQuery(".div-OrderNumber").hide(); jQuery(".div-SubmitTicket").show(); jQuery(".div-ProductQuestions").hide(); jQuery(".div-WholesaleInquiries").hide(); jQuery(".div-ApplyingforNet30terms").hide(); jQuery("#typeLabel").removeClass("red1"); jQuery("#TicketTypeDropDown").removeClass("borderRed"); jQuery("#OrderNumberLabel").parent().addClass("required"); if (ticket_type == "Existing Orders - Order Cancellation") { msg = "
" + "" + "
" + "" + "
" + "
"; jQuery(".ShowTypeMessage").append(msg); jQuery(".div-OrderNumber").show(); } else if (ticket_type == "Existing Orders - Returns & Refunds") { jQuery(".div-OrderNumber").show(); } else if (ticket_type == "Existing Orders - Shipping & Order Status") { jQuery(".div-OrderNumber").show(); } else if (ticket_type == "Existing Orders - Exchanges") { msg = "
" + "" + "
" + "" + "
" + "
"; jQuery(".ShowTypeMessage").append(msg); jQuery(".div-Email").hide(); jQuery(".div-Message").hide(); jQuery(".div-Upload").hide(); jQuery(".div-SubmitTicket").hide(); } else if (ticket_type == "Existing Orders - Payment, Billing, or Other Issues") { jQuery(".div-OrderNumber").show(); } else if (ticket_type == "Existing Orders - Defective Products") { msg = "
" + "" + "
" + "" + "
" + "
"; jQuery(".ShowTypeMessage").append(msg); jQuery(".div-OrderNumber").show(); } else if (ticket_type == "Existing Orders - Damaged Shipments") { msg = "
" + "" + "
" + "" + "
" + "
"; jQuery(".ShowTypeMessage").append(msg); jQuery(".div-OrderNumber").show(); } else if (ticket_type == "Existing Orders - Product Questions") { jQuery(".div-OrderNumber").show(); } else if (ticket_type == "Existing Orders - I received an address verification call") { msg = "
" + "" + "
" + "" + "
" + "
"; jQuery(".ShowTypeMessage").append(msg); jQuery(".div-Email").hide(); jQuery(".div-Message").hide(); jQuery(".div-Upload").hide(); jQuery(".div-SubmitTicket").hide(); } else if (ticket_type == "Existing Orders - I received an incorrect order") { msg = "
" + "" + "
" + "" + "
" + "
"; jQuery(".ShowTypeMessage").append(msg); jQuery(".div-OrderNumber").show(); } else if (ticket_type == "Promo Code / Discounts") { msg = "
" + "" + "
" + "" + "
" + "
"; jQuery(".ShowTypeMessage").append(msg); jQuery(".div-Email").hide(); jQuery(".div-Message").hide(); jQuery(".div-Upload").hide(); jQuery(".div-SubmitTicket").hide(); } else if (ticket_type == "Sales - Product Questions") { jQuery(".div-ProductQuestions").show(); } else if (ticket_type == "Sales - General Sales Inquiries / RFQ") { } else if (ticket_type == "Sales - Wholesale Inquiries") { jQuery("#EINLabel").parent().removeClass("required"); jQuery(".div-CompanyWebsite").show(); jQuery(".div-CheckBoxList").show(); jQuery(".div-TypeofBusiness").show(); jQuery(".div-WholesaleInquiries").show(); } else if (ticket_type == "Other - Applying for Net 30 terms") { jQuery("#EINLabel").parent().addClass("required"); jQuery(".div-CompanyWebsite").hide(); jQuery(".div-CheckBoxList").hide(); jQuery(".div-TypeofBusiness").hide(); jQuery(".div-WholesaleInquiries").show(); jQuery(".div-ApplyingforNet30terms").show(); } else if (ticket_type == "Other - Website & Payment Issues") { jQuery("#OrderNumberLabel").parent().removeClass("required"); jQuery(".div-OrderNumber").show(); } else if (ticket_type == "Other - Feedback, Comments, or Other Questions") { } } function SubmitTicket(ticket_type, email, messageTxt) { var yourdomain = 'allfilters'; //Your freshdesk domain name. Ex., yourcompany var freshdesKey = 'V1LjL1lCQ6gjyNUDtrk'; if (ticket_type == "Sales - General Sales Inquiries / RFQ" || ticket_type == "Sales - Wholesale Inquiries" || ticket_type == "Other - Applying for Net 30 terms") { freshdesKey = 'ByP1IiuehyNb7ERptIeB'; } // Ref: https://support.freshdesk.com/support/solutions/articles/215517-how-to-find-your-api-key var ticket_type = jQuery("#TicketTypeDropDown").val(); var formdata = new FormData(); var data = { "email": email, "type": ticket_type, "subject": SubjectString(ticket_type), "description": messageTxt, "status": "2", }; if (nestedobjectControl(ticket_type) != "") { data = { "email": email, "type": ticket_type, "subject": SubjectString(ticket_type), "description": messageTxt, "status": "2", "custom_fields": nestedobjectControl(ticket_type) }; } for (var dataKey in data) { if (dataKey === 'custom_fields') { // append nested object for (var previewKey in data[dataKey]) { formdata.append(`custom_fields[${previewKey}]`, data[dataKey][previewKey]); } } else { formdata.append(dataKey, data[dataKey]); } } var files = jQuery('#browsefile')[0].files; if (files.length > 0) { for (i = 0; i < files.length; i++) { formdata.append('attachments[]', jQuery('#browsefile')[0].files[i]); } } $.ajax({ url: "https://" + yourdomain + ".freshdesk.com/api/v2/tickets", type: 'POST', contentType: false, processData: false, headers: { "Authorization": "Basic " + btoa(freshdesKey + ":x") }, data: formdata, success: function (data, textStatus, jqXHR) { //$('#divMessage').html("Status: " + jqXHR.status + " -- " + JSON.stringify(data, null, "
")); if (ticket_type == "Existing Orders - Order Cancellation") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We handle all order cancellation requests promptly and as an urgent matter. Please note, however, that only unshipped orders can be canceled. We will check promptly and get back to you."); } else if (ticket_type == "Existing Orders - Returns & Refunds") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We generally respond to all inquiries within 4 business hours."); } else if (ticket_type == "Existing Orders - Shipping & Order Status") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We generally respond to all inquiries within 4 business hours."); } else if (ticket_type == "Existing Orders - Payment, Billing, or Other Issues") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We generally respond to all inquiries within 4 business hours."); } else if (ticket_type == "Existing Orders - Defective Products") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We will respond to your inquiry within 1 business day."); } else if (ticket_type == "Existing Orders - Damaged Shipments") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We will respond to your inquiry within 1 business day."); } else if (ticket_type == "Existing Orders - Product Questions") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We will respond to your inquiry within 1 business day."); } else if (ticket_type == "Existing Orders - I received an incorrect order") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We will respond to your inquiry within 1 business day."); } else if (ticket_type == "Sales - Product Questions") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We generally respond to all inquiries within 4 business hours."); } else if (ticket_type == "Sales - General Sales Inquiries / RFQ") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We will respond to your inquiry within 1 business day."); } else if (ticket_type == "Sales - Wholesale Inquiries") { jQuery('#divMessage').html("Thank you for your interest in placing a wholesale order with us. We will respond to your inquiry within 1 business day."); } else if (ticket_type == "Other - Applying for Net 30 terms") { jQuery('#divMessage').html("Thank you for completing the Net 30 Terms application. We will review it and get back to you within 1 business day."); } else if (ticket_type == "Other - Website & Payment Issues") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We handle website and payment issue reports promptly as an urgent matter. We will review it thoroughly and respond to you within 1 business day."); } else if (ticket_type == "Other - Feedback, Comments, or Other Questions") { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We will respond to your inquiry within 1 business day."); } else { jQuery('#divMessage').html("Thank you for contacting AllFilters.com. We will respond to your inquiry within 1 business day."); } jQuery("html, body").animate({ scrollTop: 0 }, "slow"); jQuery('#divTicketForm').hide(); jQuery('#divMessage').show(); }, error: function (jqXHR, tranStatus) { x_request_id = jqXHR.getResponseHeader('X-Request-Id'); response_text = jqXHR.responseText; //$('#divError').html("Error Message : Status: " + jqXHR.status + " -- " + response_text + ".
-- Your X-Request-Id is : " + x_request_id + ". Please contact [email protected] with this id for more information."); if (jqXHR.responseJSON != null && jqXHR.responseJSON != undefined && jqXHR.responseJSON.description == "Validation failed") { if (jqXHR.responseJSON.errors.length > 0) { jqXHR.responseJSON.errors.each(function (obj, val) { if (obj.code == "invalid_value") { if (obj.field == "email") { jQuery("#emailLabel").addClass("red1"); jQuery("#emailTextBox").addClass("borderRed"); jQuery('#divError').append("

Please enter a valid Email.

"); } else { jQuery('#divError').html("There was an error while submitting the ticket. Please try after some time."); } } else { jQuery('#divError').html("There was an error while submitting the ticket. Please try after some time."); } }); } else { jQuery('#divError').html("There was an error while submitting the ticket. Please try after some time."); } } else { jQuery('#divError').html("There was an error while submitting the ticket. Please try after some time."); } jQuery("html, body").animate({ scrollTop: 0 }, "slow"); jQuery('#divError').show(); } }); return false; } function SubjectString(ticket_type) { var orderNumber = jQuery("#OrderNumberTextBox").val(); var companyName = jQuery("#CompanyNameTextBox").val(); if (ticket_type == "Existing Orders - Order Cancellation") { return "AllFilters.com Order Cancellation - " + orderNumber + ""; } else if (ticket_type == "Existing Orders - Returns & Refunds") { return "AllFilters.com Returns/Refunds - " + orderNumber + ""; } else if (ticket_type == "Existing Orders - Shipping & Order Status") { return "AllFilters.com Order Status - " + orderNumber + ""; } else if (ticket_type == "Existing Orders - Payment, Billing, or Other Issues") { return "AllFilters.com Payment Issues - " + orderNumber + ""; } else if (ticket_type == "Existing Orders - Defective Products") { return "AllFilters.com Defective Products - " + orderNumber + ""; } else if (ticket_type == "Existing Orders - Damaged Shipments") { return "AllFilters.com Damaged Shipment - " + orderNumber + ""; } else if (ticket_type == "Existing Orders - Product Questions") { return "AllFilters.com Product Questions - " + orderNumber + ""; } else if (ticket_type == "Existing Orders - I received an incorrect order") { return "AllFilters.com Incorrect Shipment - " + orderNumber + ""; } else if (ticket_type == "Sales - Product Questions") { return "AllFilters.com - Product Questions"; } else if (ticket_type == "Sales - General Sales Inquiries / RFQ") { return "AllFilters.com - Sales Questions"; } else if (ticket_type == "Sales - Wholesale Inquiries") { return "AllFilters.com Wholesale Inquiry - " + companyName + ""; } else if (ticket_type == "Other - Applying for Net 30 terms") { return "AllFilters.com Net 30 Application - " + companyName + ""; } else if (ticket_type == "Other - Website & Payment Issues") { return "AllFilters.com - Website & Payment Issues"; } else if (ticket_type == "Other - Feedback, Comments, or Other Questions") { return "AllFilters.com - Feedback/Comments/Questions"; } return ""; } function nestedobjectControl(ticket_type) { var orderNumber = jQuery("#OrderNumberTextBox").val(); if (ticket_type == "Existing Orders - Order Cancellation") { return { "cf_order_number": orderNumber }; } else if (ticket_type == "Existing Orders - Returns & Refunds") { return { "cf_order_number551387": orderNumber }; } else if (ticket_type == "Existing Orders - Shipping & Order Status") { return { "cf_order_number94030": orderNumber }; } else if (ticket_type == "Existing Orders - Payment, Billing, or Other Issues") { return { "cf_order_number407084": orderNumber }; } else if (ticket_type == "Existing Orders - Defective Products") { return { "cf_order_number690753": orderNumber }; } else if (ticket_type == "Existing Orders - Damaged Shipments") { return { "cf_order_number687125": orderNumber }; } else if (ticket_type == "Existing Orders - Product Questions") { return { "cf_order_number138728": orderNumber }; } else if (ticket_type == "Existing Orders - I received an incorrect order") { return { "cf_order_number979569": orderNumber }; } else if (ticket_type == "Sales - Product Questions") { var nameText = jQuery("#NameTextBox").val(); var phoneText = jQuery("#PhoneTextBox").val(); if (nameText.trim() != "") { return { "cf_name": nameText, "cf_phone": phoneText }; } else { return { "cf_phone": phoneText }; } } else if (ticket_type == "Sales - Wholesale Inquiries") { var companyWebsiteText = jQuery("#CompanyWebsiteTextBox").val(); var einText = jQuery("#EINTextBox").val(); if (companyWebsiteText.trim() != "" && einText.trim() != "") { return { "cf_name750210": jQuery("#YourNameTextBox").val(), "cf_your_phone756714": jQuery("#YourPhoneTextBox").val(), "cf_company_name": jQuery("#CompanyNameTextBox").val(), "cf_company_phone": jQuery("#CompanyPhoneTextBox").val(), "cf_company_website": jQuery("#CompanyWebsiteTextBox").val(), "cf_ein": jQuery("#EINTextBox").val(), "cf_type_of_business": jQuery("#TypeofBusinessDropDown").val(), "cf_years_in_business570677": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order903993": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency59832": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_name": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city368230": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state691551": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip": jQuery("#ShippingZipTextBox").val(), "cf_refrigerator_filters": jQuery("#cf_refrigerator_filters").is(':checked'), "cf_hvac_air_filters": jQuery("#cf_hvac_air_filters").is(':checked'), "cf_sediment_filters": jQuery("#cf_sediment_filters").is(':checked'), "cf_pool_spa_filters": jQuery("#cf_pool_spa_filters").is(':checked'), "cf_carbon_filters": jQuery("#cf_carbon_filters").is(':checked'), "cf_water_softening_cartridges": jQuery("#cf_water_softening_cartridges").is(':checked'), "cf_pleated_membrane_filters": jQuery("#cf_pleated_membrane_filters").is(':checked'), "cf_bag_filters": jQuery("#cf_bag_filters").is(':checked'), "cf_other_products": jQuery("#cf_other_products").is(':checked') }; } else if (companyWebsiteText.trim() != "") { return { "cf_name750210": jQuery("#YourNameTextBox").val(), "cf_your_phone756714": jQuery("#YourPhoneTextBox").val(), "cf_company_name": jQuery("#CompanyNameTextBox").val(), "cf_company_phone": jQuery("#CompanyPhoneTextBox").val(), "cf_company_website": jQuery("#CompanyWebsiteTextBox").val(), "cf_type_of_business": jQuery("#TypeofBusinessDropDown").val(), "cf_years_in_business570677": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order903993": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency59832": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_name": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city368230": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state691551": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip": jQuery("#ShippingZipTextBox").val(), "cf_refrigerator_filters": jQuery("#cf_refrigerator_filters").is(':checked'), "cf_hvac_air_filters": jQuery("#cf_hvac_air_filters").is(':checked'), "cf_sediment_filters": jQuery("#cf_sediment_filters").is(':checked'), "cf_pool_spa_filters": jQuery("#cf_pool_spa_filters").is(':checked'), "cf_carbon_filters": jQuery("#cf_carbon_filters").is(':checked'), "cf_water_softening_cartridges": jQuery("#cf_water_softening_cartridges").is(':checked'), "cf_pleated_membrane_filters": jQuery("#cf_pleated_membrane_filters").is(':checked'), "cf_bag_filters": jQuery("#cf_bag_filters").is(':checked'), "cf_other_products": jQuery("#cf_other_products").is(':checked') }; } else if (einText.trim() != "") { return { "cf_name750210": jQuery("#YourNameTextBox").val(), "cf_your_phone756714": jQuery("#YourPhoneTextBox").val(), "cf_company_name": jQuery("#CompanyNameTextBox").val(), "cf_company_phone": jQuery("#CompanyPhoneTextBox").val(), "cf_ein": jQuery("#EINTextBox").val(), "cf_type_of_business": jQuery("#TypeofBusinessDropDown").val(), "cf_years_in_business570677": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order903993": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency59832": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_name": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city368230": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state691551": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip": jQuery("#ShippingZipTextBox").val(), "cf_refrigerator_filters": jQuery("#cf_refrigerator_filters").is(':checked'), "cf_hvac_air_filters": jQuery("#cf_hvac_air_filters").is(':checked'), "cf_sediment_filters": jQuery("#cf_sediment_filters").is(':checked'), "cf_pool_spa_filters": jQuery("#cf_pool_spa_filters").is(':checked'), "cf_carbon_filters": jQuery("#cf_carbon_filters").is(':checked'), "cf_water_softening_cartridges": jQuery("#cf_water_softening_cartridges").is(':checked'), "cf_pleated_membrane_filters": jQuery("#cf_pleated_membrane_filters").is(':checked'), "cf_bag_filters": jQuery("#cf_bag_filters").is(':checked'), "cf_other_products": jQuery("#cf_other_products").is(':checked') }; } else { return { "cf_name750210": jQuery("#YourNameTextBox").val(), "cf_your_phone756714": jQuery("#YourPhoneTextBox").val(), "cf_company_name": jQuery("#CompanyNameTextBox").val(), "cf_company_phone": jQuery("#CompanyPhoneTextBox").val(), "cf_type_of_business": jQuery("#TypeofBusinessDropDown").val(), "cf_years_in_business570677": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order903993": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency59832": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_name": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city368230": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state691551": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip": jQuery("#ShippingZipTextBox").val(), "cf_refrigerator_filters": jQuery("#cf_refrigerator_filters").is(':checked'), "cf_hvac_air_filters": jQuery("#cf_hvac_air_filters").is(':checked'), "cf_sediment_filters": jQuery("#cf_sediment_filters").is(':checked'), "cf_pool_spa_filters": jQuery("#cf_pool_spa_filters").is(':checked'), "cf_carbon_filters": jQuery("#cf_carbon_filters").is(':checked'), "cf_water_softening_cartridges": jQuery("#cf_water_softening_cartridges").is(':checked'), "cf_pleated_membrane_filters": jQuery("#cf_pleated_membrane_filters").is(':checked'), "cf_bag_filters": jQuery("#cf_bag_filters").is(':checked'), "cf_other_products": jQuery("#cf_other_products").is(':checked') }; } } else if (ticket_type == "Other - Applying for Net 30 terms") { var TradeReference1Text = jQuery("#TradeReference1TextBox").val(); var TradeReference2Text = jQuery("#TradeReference2TextBox").val(); var TradeReference3Text = jQuery("#TradeReference3TextBox").val(); if (TradeReference1Text.trim() != "" && TradeReference2Text.trim() != "" && TradeReference3Text.trim() != "") { return { "cf_your_name": jQuery("#YourNameTextBox").val(), "cf_your_phone": jQuery("#YourPhoneTextBox").val(), "cf_name327718": jQuery("#CompanyNameTextBox").val(), "cf_phone594571": jQuery("#CompanyPhoneTextBox").val(), "cf_ein845588": jQuery("#EINTextBox").val(), "cf_years_in_business672430": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order494980": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency9671": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing260556": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_address": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip455917": jQuery("#ShippingZipTextBox").val(), "cf_billing_contact_name": jQuery("#BillingContactNameTextBox").val(), "cf_billling_email": jQuery("#BillingEmailTextBox").val().trim(), "cf_billing_phone791817": jQuery("#BillingPhoneTextBox").val(), "cf_trade_reference_1_company_name_contact_person_phone_and_email": jQuery("#TradeReference1TextBox").val(), "cf_trade_reference_2_company_name_contact_person_phone_and_email": jQuery("#TradeReference2TextBox").val(), "cf_trade_reference_3_company_name_contact_person_phone_and_email": jQuery("#TradeReference3TextBox").val() }; } else if (TradeReference1Text.trim() != "" && TradeReference2Text.trim() != "") { return { "cf_your_name": jQuery("#YourNameTextBox").val(), "cf_your_phone": jQuery("#YourPhoneTextBox").val(), "cf_name327718": jQuery("#CompanyNameTextBox").val(), "cf_phone594571": jQuery("#CompanyPhoneTextBox").val(), "cf_ein845588": jQuery("#EINTextBox").val(), "cf_years_in_business672430": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order494980": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency9671": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing260556": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_address": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip455917": jQuery("#ShippingZipTextBox").val(), "cf_billing_contact_name": jQuery("#BillingContactNameTextBox").val(), "cf_billling_email": jQuery("#BillingEmailTextBox").val().trim(), "cf_billing_phone791817": jQuery("#BillingPhoneTextBox").val(), "cf_trade_reference_1_company_name_contact_person_phone_and_email": jQuery("#TradeReference1TextBox").val(), "cf_trade_reference_2_company_name_contact_person_phone_and_email": jQuery("#TradeReference2TextBox").val(), }; } else if (TradeReference1Text.trim() != "" && TradeReference3Text.trim() != "") { return { "cf_your_name": jQuery("#YourNameTextBox").val(), "cf_your_phone": jQuery("#YourPhoneTextBox").val(), "cf_name327718": jQuery("#CompanyNameTextBox").val(), "cf_phone594571": jQuery("#CompanyPhoneTextBox").val(), "cf_ein845588": jQuery("#EINTextBox").val(), "cf_years_in_business672430": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order494980": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency9671": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing260556": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_address": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip455917": jQuery("#ShippingZipTextBox").val(), "cf_billing_contact_name": jQuery("#BillingContactNameTextBox").val(), "cf_billling_email": jQuery("#BillingEmailTextBox").val().trim(), "cf_billing_phone791817": jQuery("#BillingPhoneTextBox").val(), "cf_trade_reference_1_company_name_contact_person_phone_and_email": jQuery("#TradeReference1TextBox").val(), "cf_trade_reference_3_company_name_contact_person_phone_and_email": jQuery("#TradeReference3TextBox").val() }; } else if (TradeReference2Text.trim() != "" && TradeReference3Text.trim() != "") { return { "cf_your_name": jQuery("#YourNameTextBox").val(), "cf_your_phone": jQuery("#YourPhoneTextBox").val(), "cf_name327718": jQuery("#CompanyNameTextBox").val(), "cf_phone594571": jQuery("#CompanyPhoneTextBox").val(), "cf_ein845588": jQuery("#EINTextBox").val(), "cf_years_in_business672430": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order494980": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency9671": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing260556": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_address": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip455917": jQuery("#ShippingZipTextBox").val(), "cf_billing_contact_name": jQuery("#BillingContactNameTextBox").val(), "cf_billling_email": jQuery("#BillingEmailTextBox").val().trim(), "cf_billing_phone791817": jQuery("#BillingPhoneTextBox").val(), "cf_trade_reference_2_company_name_contact_person_phone_and_email": jQuery("#TradeReference2TextBox").val(), "cf_trade_reference_3_company_name_contact_person_phone_and_email": jQuery("#TradeReference3TextBox").val() }; } else if (TradeReference1Text.trim() != "") { return { "cf_your_name": jQuery("#YourNameTextBox").val(), "cf_your_phone": jQuery("#YourPhoneTextBox").val(), "cf_name327718": jQuery("#CompanyNameTextBox").val(), "cf_phone594571": jQuery("#CompanyPhoneTextBox").val(), "cf_ein845588": jQuery("#EINTextBox").val(), "cf_years_in_business672430": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order494980": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency9671": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing260556": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_address": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip455917": jQuery("#ShippingZipTextBox").val(), "cf_billing_contact_name": jQuery("#BillingContactNameTextBox").val(), "cf_billling_email": jQuery("#BillingEmailTextBox").val().trim(), "cf_billing_phone791817": jQuery("#BillingPhoneTextBox").val(), "cf_trade_reference_1_company_name_contact_person_phone_and_email": jQuery("#TradeReference1TextBox").val() }; } else if (TradeReference2Text.trim() != "") { return { "cf_your_name": jQuery("#YourNameTextBox").val(), "cf_your_phone": jQuery("#YourPhoneTextBox").val(), "cf_name327718": jQuery("#CompanyNameTextBox").val(), "cf_phone594571": jQuery("#CompanyPhoneTextBox").val(), "cf_ein845588": jQuery("#EINTextBox").val(), "cf_years_in_business672430": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order494980": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency9671": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing260556": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_address": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip455917": jQuery("#ShippingZipTextBox").val(), "cf_billing_contact_name": jQuery("#BillingContactNameTextBox").val(), "cf_billling_email": jQuery("#BillingEmailTextBox").val().trim(), "cf_billing_phone791817": jQuery("#BillingPhoneTextBox").val(), "cf_trade_reference_2_company_name_contact_person_phone_and_email": jQuery("#TradeReference2TextBox").val() }; } else if (TradeReference3Text.trim() != "") { return { "cf_your_name": jQuery("#YourNameTextBox").val(), "cf_your_phone": jQuery("#YourPhoneTextBox").val(), "cf_name327718": jQuery("#CompanyNameTextBox").val(), "cf_phone594571": jQuery("#CompanyPhoneTextBox").val(), "cf_ein845588": jQuery("#EINTextBox").val(), "cf_years_in_business672430": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order494980": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency9671": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing260556": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_address": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip455917": jQuery("#ShippingZipTextBox").val(), "cf_billing_contact_name": jQuery("#BillingContactNameTextBox").val(), "cf_billling_email": jQuery("#BillingEmailTextBox").val().trim(), "cf_billing_phone791817": jQuery("#BillingPhoneTextBox").val(), "cf_trade_reference_3_company_name_contact_person_phone_and_email": jQuery("#TradeReference3TextBox").val() }; } else { return { "cf_your_name": jQuery("#YourNameTextBox").val(), "cf_your_phone": jQuery("#YourPhoneTextBox").val(), "cf_name327718": jQuery("#CompanyNameTextBox").val(), "cf_phone594571": jQuery("#CompanyPhoneTextBox").val(), "cf_ein845588": jQuery("#EINTextBox").val(), "cf_years_in_business672430": jQuery("#YearsinBusinessDropdown").val(), "cf_estimated_average_order_volume_per_order494980": jQuery("#EstimatedAverageOrderVolumeDropDown").val(), "cf_estimated_order_frequency9671": jQuery("#EstimatedOrderFrequencyDropDown").val(), "cf_items_interested_in_purchasing260556": jQuery("#ItemsInterestedinPurchasingTextBox").val(), "cf_shipping_street_address": jQuery("#ShippingStreetNameTextBox").val(), "cf_shipping_city": jQuery("#ShippingCityTextBox").val(), "cf_shipping_state": jQuery("#ShippingStateDropDown").val(), "cf_shipping_zip455917": jQuery("#ShippingZipTextBox").val(), "cf_billing_contact_name": jQuery("#BillingContactNameTextBox").val(), "cf_billling_email": jQuery("#BillingEmailTextBox").val().trim(), "cf_billing_phone791817": jQuery("#BillingPhoneTextBox").val() }; } } else if (ticket_type == "Other - Website & Payment Issues") { if (orderNumber.trim() != "") { return { "cf_order_number865769": orderNumber }; } } return ""; } var validation = { isEmailAddress: function (str) { var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; return pattern.test(str); // returns a boolean }, isNotEmpty: function (str) { var pattern = /\S+/; return pattern.test(str); // returns a boolean }, isNumber: function (str) { var pattern = /^\d+$/; return pattern.test(str); // returns a boolean }, isSame: function (str1, str2) { return str1 === str2; } }; function noSpaceText(event) { var keyCode = event.keyCode; var character = String.fromCharCode(keyCode); // Allow no Space. if (keyCode != 32) { return true; } // Prevent all other characters. event.preventDefault(); return false; } jQuery(document).ready(function () { jQuery("#SubmitTicketButton").click(function (event) { jQuery('#divMessage').html(""); jQuery('#divMessage').hide(); jQuery('#divError').html(""); jQuery('#divError').hide(); jQuery("#MessageTextBox").val(messageTxt); var ticket_type = jQuery("#TicketTypeDropDown").val(); var attachedItem = jQuery("#ticket-attachments span").hasClass("item"); var email = jQuery("#emailTextBox").val().trim(); var orderNumber = jQuery("#OrderNumberTextBox").val(); var messageTxt = editor.getData(); jQuery("#typeLabel").removeClass("red1"); jQuery("#TicketTypeDropDown").removeClass("borderRed"); jQuery("#helpdesk_ticket_custom_field_cf_ticket_file-error").remove() if (ticket_type == "Existing Orders - Order Cancellation" || ticket_type == "Existing Orders - Returns & Refunds" || ticket_type == "Existing Orders - Shipping & Order Status" || ticket_type == "Existing Orders - Payment, Billing, or Other Issues" || ticket_type == "Existing Orders - Product Questions") { if (email.trim() == "") { jQuery("#emailLabel").addClass("red1"); jQuery("#emailTextBox").addClass("borderRed"); } else { jQuery("#emailLabel").removeClass("red1"); jQuery("#emailTextBox").removeClass("borderRed"); } if (orderNumber.trim() == "") { jQuery("#OrderNumberLabel").addClass("red1"); jQuery("#OrderNumberTextBox").addClass("borderRed"); } else { jQuery("#OrderNumberLabel").removeClass("red1"); jQuery("#OrderNumberTextBox").removeClass("borderRed"); } if (messageTxt.trim() == "") { jQuery("#MessageLabel").addClass("red1"); jQuery(".ck-editor__editable").addClass("borderRed"); } else { jQuery("#MessageLabel").removeClass("red1"); jQuery(".ck-editor__editable").removeClass("borderRed"); } if (email.trim() == "" || orderNumber.trim() == "" || messageTxt.trim() == "") { jQuery("html, body").animate({ scrollTop: 0 }, "slow"); jQuery('#divError').html("All fields marked with * are required."); jQuery('#divError').show(); return false; } else { SubmitTicket(ticket_type, email, messageTxt.trim()); } } else if (ticket_type == "Existing Orders - Defective Products" || ticket_type == "Existing Orders - Damaged Shipments" || ticket_type == "Existing Orders - I received an incorrect order") { jQuery('#divError').html(""); if (email.trim() == "") { jQuery('#divError').html(""); jQuery('#divError').append("

All fields marked with * are required.

"); jQuery("#emailLabel").addClass("red1"); jQuery("#emailTextBox").addClass("borderRed"); } else { jQuery("#emailLabel").removeClass("red1"); jQuery("#emailTextBox").removeClass("borderRed"); } if (orderNumber.trim() == "") { jQuery('#divError').html(""); jQuery('#divError').append("

All fields marked with * are required.

"); jQuery("#OrderNumberLabel").addClass("red1"); jQuery("#OrderNumberTextBox").addClass("borderRed"); } else { jQuery("#OrderNumberLabel").removeClass("red1"); jQuery("#OrderNumberTextBox").removeClass("borderRed"); } if (messageTxt.trim() == "") { jQuery('#divError').html(""); jQuery('#divError').append("

All fields marked with * are required.

"); jQuery("#MessageLabel").addClass("red1"); jQuery(".ck-editor__editable").addClass("borderRed"); } else { jQuery("#MessageLabel").removeClass("red1"); jQuery(".ck-editor__editable").removeClass("borderRed"); } if (attachedItem == false) { event.preventDefault(); jQuery(".single_file").append("
Please attach at least one image.
"); jQuery('#divError').append("

Please attach at least one image.

"); jQuery('#divError').show(); return false; } if (email.trim() == "" || orderNumber.trim() == "" || messageTxt.trim() == "") { jQuery("html, body").animate({ scrollTop: 0 }, "slow"); jQuery('#divError').show(); return false; } else { SubmitTicket(ticket_type, email, messageTxt.trim()); } } else if (ticket_type == "Sales - Product Questions") { var phoneText = jQuery("#PhoneTextBox").val(); if (email.trim() == "") { jQuery("#emailLabel").addClass("red1"); jQuery("#emailTextBox").addClass("borderRed"); } else { jQuery("#emailLabel").removeClass("red1"); jQuery("#emailTextBox").removeClass("borderRed"); } if (phoneText.trim() == "") { jQuery("#PhoneLabel").addClass("red1"); jQuery("#PhoneTextBox").addClass("borderRed"); } else { jQuery("#PhoneLabel").removeClass("red1"); jQuery("#PhoneTextBox").removeClass("borderRed"); } if (messageTxt.trim() == "") { jQuery("#MessageLabel").addClass("red1"); jQuery(".ck-editor__editable").addClass("borderRed"); } else { jQuery("#MessageLabel").removeClass("red1"); jQuery(".ck-editor__editable").removeClass("borderRed"); } if (email.trim() == "" || phoneText.trim() == "" || messageTxt.trim() == "") { jQuery("html, body").animate({ scrollTop: 0 }, "slow"); jQuery('#divError').html("All fields marked with * are required."); jQuery('#divError').show(); return false; } else { SubmitTicket(ticket_type, email, messageTxt.trim()); } } else if (ticket_type == "Sales - General Sales Inquiries / RFQ" || ticket_type == "Other - Feedback, Comments, or Other Questions") { if (email.trim() == "") { jQuery("#emailLabel").addClass("red1"); jQuery("#emailTextBox").addClass("borderRed"); } else { jQuery("#emailLabel").removeClass("red1"); jQuery("#emailTextBox").removeClass("borderRed"); } if (messageTxt.trim() == "") { jQuery("#MessageLabel").addClass("red1"); jQuery(".ck-editor__editable").addClass("borderRed"); } else { jQuery("#MessageLabel").removeClass("red1"); jQuery(".ck-editor__editable").removeClass("borderRed"); } if (email == "" || messageTxt == "") { jQuery("html, body").animate({ scrollTop: 0 }, "slow"); jQuery('#divError').html("All fields marked with * are required."); jQuery('#divError').show(); return false; } else { SubmitTicket(ticket_type, email, messageTxt.trim()); } } else if (ticket_type == "Sales - Wholesale Inquiries") { if (email.trim() == "") { jQuery("#emailLabel").addClass("red1"); jQuery("#emailTextBox").addClass("borderRed"); } else { jQuery("#emailLabel").removeClass("red1"); jQuery("#emailTextBox").removeClass("borderRed"); } if (jQuery("#YourNameTextBox").val().trim() == "") { jQuery("#YourNameLabel").addClass("red1"); jQuery("#YourNameTextBox").addClass("borderRed"); } else { jQuery("#YourNameLabel").removeClass("red1"); jQuery("#YourNameTextBox").removeClass("borderRed"); } if (jQuery("#YourPhoneTextBox").val().trim() == "") { jQuery("#YourPhoneLabel").addClass("red1"); jQuery("#YourPhoneTextBox").addClass("borderRed"); } else { jQuery("#YourPhoneLabel").removeClass("red1"); jQuery("#YourPhoneTextBox").removeClass("borderRed"); } if (jQuery("#CompanyNameTextBox").val().trim() == "") { jQuery("#CompanyNameLabel").addClass("red1"); jQuery("#CompanyNameTextBox").addClass("borderRed"); } else { jQuery("#CompanyNameLabel").removeClass("red1"); jQuery("#CompanyNameTextBox").removeClass("borderRed"); } if (jQuery("#CompanyPhoneTextBox").val().trim() == "") { jQuery("#CompanyPhoneLabel").addClass("red1"); jQuery("#CompanyPhoneTextBox").addClass("borderRed"); } else { jQuery("#CompanyPhoneLabel").removeClass("red1"); jQuery("#CompanyPhoneTextBox").removeClass("borderRed"); } if (jQuery("#TypeofBusinessDropDown").val().trim() == "") { jQuery("#TypeofBusinessLabel").addClass("red1"); jQuery("#TypeofBusinessDropDown").addClass("borderRed"); } else { jQuery("#TypeofBusinessLabel").removeClass("red1"); jQuery("#TypeofBusinessDropDown").removeClass("borderRed"); } if (jQuery("#YearsinBusinessDropdown").val().trim() == "") { jQuery("#YearsinBusinessLabel").addClass("red1"); jQuery("#YearsinBusinessDropdown").addClass("borderRed"); } else { jQuery("#YearsinBusinessLabel").removeClass("red1"); jQuery("#YearsinBusinessDropdown").removeClass("borderRed"); } if (jQuery("#EstimatedAverageOrderVolumeDropDown").val().trim() == "") { jQuery("#EstimatedAverageOrderVolumeLabel").addClass("red1"); jQuery("#EstimatedAverageOrderVolumeDropDown").addClass("borderRed"); } else { jQuery("#EstimatedAverageOrderVolumeLabel").removeClass("red1"); jQuery("#EstimatedAverageOrderVolumeDropDown").removeClass("borderRed"); } if (jQuery("#EstimatedOrderFrequencyDropDown").val().trim() == "") { jQuery("#EstimatedOrderFrequencyLabel").addClass("red1"); jQuery("#EstimatedOrderFrequencyDropDown").addClass("borderRed"); } else { jQuery("#EstimatedOrderFrequencyLabel").removeClass("red1"); jQuery("#EstimatedOrderFrequencyDropDown").removeClass("borderRed"); } if (jQuery("#ItemsInterestedinPurchasingTextBox").val().trim() == "") { jQuery("#ItemsInterestedinPurchasingLabel").addClass("red1"); jQuery("#ItemsInterestedinPurchasingTextBox").addClass("borderRed"); } else { jQuery("#ItemsInterestedinPurchasingLabel").removeClass("red1"); jQuery("#ItemsInterestedinPurchasingTextBox").removeClass("borderRed"); } if (jQuery("#ShippingStreetNameTextBox").val().trim() == "") { jQuery("#ShippingStreetNameLabel").addClass("red1"); jQuery("#ShippingStreetNameTextBox").addClass("borderRed"); } else { jQuery("#ShippingStreetNameLabel").removeClass("red1"); jQuery("#ShippingStreetNameTextBox").removeClass("borderRed"); } if (jQuery("#ShippingCityTextBox").val().trim() == "") { jQuery("#ShippingCityLabel").addClass("red1"); jQuery("#ShippingCityTextBox").addClass("borderRed"); } else { jQuery("#ShippingCityLabel").removeClass("red1"); jQuery("#ShippingCityTextBox").removeClass("borderRed"); } if (jQuery("#ShippingStateDropDown").val().trim() == "") { jQuery("#ShippingStateLabel").addClass("red1"); jQuery("#ShippingStateDropDown").addClass("borderRed"); } else { jQuery("#ShippingStateLabel").removeClass("red1"); jQuery("#ShippingStateDropDown").removeClass("borderRed"); } if (jQuery("#ShippingZipTextBox").val().trim() == "") { jQuery("#ShippingZipLabel").addClass("red1"); jQuery("#ShippingZipTextBox").addClass("borderRed"); } else { jQuery("#ShippingZipLabel").removeClass("red1"); jQuery("#ShippingZipTextBox").removeClass("borderRed"); } if (messageTxt.trim() == "") { jQuery("#MessageLabel").addClass("red1"); jQuery(".ck-editor__editable").addClass("borderRed"); } else { jQuery("#MessageLabel").removeClass("red1"); jQuery(".ck-editor__editable").removeClass("borderRed"); } if (email.trim() == "" || jQuery("#YourNameTextBox").val().trim() == "" || jQuery("#YourPhoneTextBox").val().trim() == "" || jQuery("#CompanyNameTextBox").val().trim() == "" || jQuery("#CompanyPhoneTextBox").val().trim() == "" || jQuery("#TypeofBusinessDropDown").val().trim() == "" || jQuery("#YearsinBusinessDropdown").val().trim() == "" || jQuery("#EstimatedAverageOrderVolumeDropDown").val().trim() == "" || jQuery("#EstimatedOrderFrequencyDropDown").val().trim() == "" || jQuery("#ItemsInterestedinPurchasingTextBox").val().trim() == "" || jQuery("#ShippingStreetNameTextBox").val().trim() == "" || jQuery("#ShippingCityTextBox").val().trim() == "" || jQuery("#ShippingStateDropDown").val().trim() == "" || jQuery("#ShippingZipTextBox").val().trim() == "" || messageTxt.trim() == "") { jQuery("html, body").animate({ scrollTop: 0 }, "slow"); jQuery('#divError').html("All fields marked with * are required."); jQuery('#divError').show(); return false; } else { SubmitTicket(ticket_type, email, messageTxt.trim()); } } else if (ticket_type == "Other - Applying for Net 30 terms") { if (email.trim() == "") { jQuery("#emailLabel").addClass("red1"); jQuery("#emailTextBox").addClass("borderRed"); } else { jQuery("#emailLabel").removeClass("red1"); jQuery("#emailTextBox").removeClass("borderRed"); } if (jQuery("#YourNameTextBox").val().trim() == "") { jQuery("#YourNameLabel").addClass("red1"); jQuery("#YourNameTextBox").addClass("borderRed"); } else { jQuery("#YourNameLabel").removeClass("red1"); jQuery("#YourNameTextBox").removeClass("borderRed"); } if (jQuery("#YourPhoneTextBox").val().trim() == "") { jQuery("#YourPhoneLabel").addClass("red1"); jQuery("#YourPhoneTextBox").addClass("borderRed"); } else { jQuery("#YourPhoneLabel").removeClass("red1"); jQuery("#YourPhoneTextBox").removeClass("borderRed"); } if (jQuery("#CompanyNameTextBox").val().trim() == "") { jQuery("#CompanyNameLabel").addClass("red1"); jQuery("#CompanyNameTextBox").addClass("borderRed"); } else { jQuery("#CompanyNameLabel").removeClass("red1"); jQuery("#CompanyNameTextBox").removeClass("borderRed"); } if (jQuery("#CompanyPhoneTextBox").val().trim() == "") { jQuery("#CompanyPhoneLabel").addClass("red1"); jQuery("#CompanyPhoneTextBox").addClass("borderRed"); } else { jQuery("#CompanyPhoneLabel").removeClass("red1"); jQuery("#CompanyPhoneTextBox").removeClass("borderRed"); } if (jQuery("#EINTextBox").val().trim() == "") { jQuery("#EINLabel").addClass("red1"); jQuery("#EINTextBox").addClass("borderRed"); } else { jQuery("#EINLabel").removeClass("red1"); jQuery("#EINTextBox").removeClass("borderRed"); } if (jQuery("#YearsinBusinessDropdown").val().trim() == "") { jQuery("#YearsinBusinessLabel").addClass("red1"); jQuery("#YearsinBusinessDropdown").addClass("borderRed"); } else { jQuery("#YearsinBusinessLabel").removeClass("red1"); jQuery("#YearsinBusinessDropdown").removeClass("borderRed"); } if (jQuery("#EstimatedAverageOrderVolumeDropDown").val().trim() == "") { jQuery("#EstimatedAverageOrderVolumeLabel").addClass("red1"); jQuery("#EstimatedAverageOrderVolumeDropDown").addClass("borderRed"); } else { jQuery("#EstimatedAverageOrderVolumeLabel").removeClass("red1"); jQuery("#EstimatedAverageOrderVolumeDropDown").removeClass("borderRed"); } if (jQuery("#EstimatedOrderFrequencyDropDown").val().trim() == "") { jQuery("#EstimatedOrderFrequencyLabel").addClass("red1"); jQuery("#EstimatedOrderFrequencyDropDown").addClass("borderRed"); } else { jQuery("#EstimatedOrderFrequencyLabel").removeClass("red1"); jQuery("#EstimatedOrderFrequencyDropDown").removeClass("borderRed"); } if (jQuery("#ItemsInterestedinPurchasingTextBox").val().trim() == "") { jQuery("#ItemsInterestedinPurchasingLabel").addClass("red1"); jQuery("#ItemsInterestedinPurchasingTextBox").addClass("borderRed"); } else { jQuery("#ItemsInterestedinPurchasingLabel").removeClass("red1"); jQuery("#ItemsInterestedinPurchasingTextBox").removeClass("borderRed"); } if (jQuery("#ShippingStreetNameTextBox").val().trim() == "") { jQuery("#ShippingStreetNameLabel").addClass("red1"); jQuery("#ShippingStreetNameTextBox").addClass("borderRed"); } else { jQuery("#ShippingStreetNameLabel").removeClass("red1"); jQuery("#ShippingStreetNameTextBox").removeClass("borderRed"); } if (jQuery("#ShippingCityTextBox").val().trim() == "") { jQuery("#ShippingCityLabel").addClass("red1"); jQuery("#ShippingCityTextBox").addClass("borderRed"); } else { jQuery("#ShippingCityLabel").removeClass("red1"); jQuery("#ShippingCityTextBox").removeClass("borderRed"); } if (jQuery("#ShippingStateDropDown").val().trim() == "") { jQuery("#ShippingStateLabel").addClass("red1"); jQuery("#ShippingStateDropDown").addClass("borderRed"); } else { jQuery("#ShippingStateLabel").removeClass("red1"); jQuery("#ShippingStateDropDown").removeClass("borderRed"); } if (jQuery("#ShippingZipTextBox").val().trim() == "") { jQuery("#ShippingZipLabel").addClass("red1"); jQuery("#ShippingZipTextBox").addClass("borderRed"); } else { jQuery("#ShippingZipLabel").removeClass("red1"); jQuery("#ShippingZipTextBox").removeClass("borderRed"); } if (jQuery("#BillingContactNameTextBox").val().trim() == "") { jQuery("#BillingContactNameLabel").addClass("red1"); jQuery("#BillingContactNameTextBox").addClass("borderRed"); } else { jQuery("#BillingContactNameLabel").removeClass("red1"); jQuery("#BillingContactNameTextBox").removeClass("borderRed"); } if (jQuery("#BillingEmailTextBox").val().trim() == "") { jQuery("#BillingEmailLabel").addClass("red1"); jQuery("#BillingEmailTextBox").addClass("borderRed"); } else { jQuery("#BillingEmailLabel").removeClass("red1"); jQuery("#BillingEmailTextBox").removeClass("borderRed"); } if (jQuery("#BillingPhoneTextBox").val().trim() == "") { jQuery("#BillingPhoneLabel").addClass("red1"); jQuery("#BillingPhoneTextBox").addClass("borderRed"); } else { jQuery("#BillingPhoneLabel").removeClass("red1"); jQuery("#BillingPhoneTextBox").removeClass("borderRed"); } if (messageTxt.trim() == "") { jQuery("#MessageLabel").addClass("red1"); jQuery(".ck-editor__editable").addClass("borderRed"); } else { jQuery("#MessageLabel").removeClass("red1"); jQuery(".ck-editor__editable").removeClass("borderRed"); } if (email.trim() == "" || jQuery("#YourNameTextBox").val().trim() == "" || jQuery("#YourPhoneTextBox").val().trim() == "" || jQuery("#CompanyNameTextBox").val().trim() == "" || jQuery("#CompanyPhoneTextBox").val().trim() == "" || jQuery("#EINTextBox").val().trim() == "" || jQuery("#YearsinBusinessDropdown").val().trim() == "" || jQuery("#EstimatedAverageOrderVolumeDropDown").val().trim() == "" || jQuery("#EstimatedOrderFrequencyDropDown").val().trim() == "" || jQuery("#ItemsInterestedinPurchasingTextBox").val().trim() == "" || jQuery("#ShippingStreetNameTextBox").val().trim() == "" || jQuery("#ShippingCityTextBox").val().trim() == "" || jQuery("#ShippingStateDropDown").val().trim() == "" || jQuery("#ShippingZipTextBox").val().trim() == "" || jQuery("#BillingContactNameTextBox").val().trim() == "" || jQuery("#BillingEmailTextBox").val().trim() == "" || jQuery("#BillingPhoneTextBox").val().trim() == "" || messageTxt.trim() == "") { jQuery("html, body").animate({ scrollTop: 0 }, "slow"); jQuery('#divError').html("All fields marked with * are required."); jQuery('#divError').show(); return false; } else if (!validation.isEmailAddress(jQuery("#BillingEmailTextBox").val().trim())) { jQuery("#BillingEmailLabel").addClass("red1"); jQuery("#BillingEmailTextBox").addClass("borderRed"); jQuery('#divError').append("

Please enter a valid Billing Email.

"); jQuery('#divError').show(); return false; } else { SubmitTicket(ticket_type, email, messageTxt.trim()); } } else if (ticket_type == "Other - Website & Payment Issues") { if (email.trim() == "") { jQuery("#emailLabel").addClass("red1"); jQuery("#emailTextBox").addClass("borderRed"); } else { jQuery("#emailLabel").removeClass("red1"); jQuery("#emailTextBox").removeClass("borderRed"); } if (messageTxt.trim() == "") { jQuery("#MessageLabel").addClass("red1"); jQuery(".ck-editor__editable").addClass("borderRed"); } else { jQuery("#MessageLabel").removeClass("red1"); jQuery(".ck-editor__editable").removeClass("borderRed"); } if (email.trim() == "" || messageTxt.trim() == "") { jQuery("html, body").animate({ scrollTop: 0 }, "slow"); jQuery('#divError').html("All fields marked with * are required."); jQuery('#divError').show(); return false; } else { SubmitTicket(ticket_type, email, messageTxt.trim()); } } else if (ticket_type == "none") { if (email.trim() == "") { jQuery("#emailLabel").addClass("red1"); jQuery("#emailTextBox").addClass("borderRed"); } else { jQuery("#emailLabel").removeClass("red1"); jQuery("#emailTextBox").removeClass("borderRed"); } if (messageTxt.trim() == "") { jQuery("#MessageLabel").addClass("red1"); jQuery(".ck-editor__editable").addClass("borderRed"); } else { jQuery("#MessageLabel").removeClass("red1"); jQuery(".ck-editor__editable").removeClass("borderRed"); } jQuery("#typeLabel").addClass("red1"); jQuery("#TicketTypeDropDown").addClass("borderRed"); jQuery("html, body").animate({ scrollTop: 0 }, "slow"); jQuery('#divError').html("All fields marked with * are required."); jQuery('#divError').show(); return false; } }); onTypechange(); jQuery("#TicketTypeDropDown").on("change", function (event) { onTypechange(); }); jQuery("#emailTextBox").on('blur', function () { jQuery('.emailError').remove(); if (jQuery('#divError').html().trim() == "") { jQuery('#divError').hide(); } if (jQuery("#emailTextBox").val().trim() != "" && !validation.isEmailAddress(jQuery("#emailTextBox").val().trim())) { jQuery("#emailLabel").addClass("red1"); jQuery("#emailTextBox").addClass("borderRed"); jQuery('#divError').append("

Please enter a valid Email.

"); jQuery('#divError').show(); } else { jQuery("#emailLabel").removeClass("red1"); jQuery("#emailTextBox").removeClass("borderRed"); } }); jQuery("#BillingEmailTextBox").on('blur', function () { jQuery('.billingEmailError').remove(); if (jQuery('#divError').html().trim() == "") { jQuery('#divError').hide(); } if (jQuery("#BillingEmailTextBox").val().trim() != "" && !validation.isEmailAddress(jQuery("#BillingEmailTextBox").val().trim())) { jQuery("#BillingEmailLabel").addClass("red1"); jQuery("#BillingEmailTextBox").addClass("borderRed"); jQuery('#divError').append("

Please enter a valid Billing Email.

"); jQuery('#divError').show(); } else { jQuery("#BillingEmailLabel").removeClass("red1"); jQuery("#BillingEmailTextBox").removeClass("borderRed"); } }); jQuery('#drpOpenCategories').click(function () { if (jQuery('#chkCategories').hasClass("showList")) { jQuery('#chkCategories').removeClass("showList"); jQuery('#chkCategories').hide(); } else { jQuery('#chkCategories').addClass("showList"); jQuery('#chkCategories').show(); } }); jQuery(document).click(function (e) { if (jQuery(e.target).parents(".drpOpenCategories").length === 0) { jQuery('#chkCategories').removeClass("showList"); jQuery('#chkCategories').hide(); } }); jQuery("#chkCategories input").on("click, change", function () { var selectedStatus = ''; jQuery("#chkCategories input").each(function () { if (jQuery(this).is(':checked')) { selectedStatus += jQuery(this).parents('label').text().trim() + ', '; } }); if (selectedStatus == "") { selectedStatus = "..." } else { selectedStatus = selectedStatus.trim().slice(0, -1); } jQuery("#drpOpenCategories").html(selectedStatus); }); document.getElementById("emailTextBox").addEventListener("keypress", noSpaceText); document.getElementById("BillingEmailTextBox").addEventListener("keypress", noSpaceText); jQuery("#emailTextBox,#BillingEmailTextBox").on("change", function (e) { var value = this.value; if (value.indexOf(" ") != -1) { value = value.replace(/ /g, ""); this.value = value; } }); });