JSFiddle - React, Tailwind, and code Playground

by Vasiliy

JavaScript

(function() {
var promoForm = $('.promo-code-form');
if (window.adoric && promoForm) {
	$('.promo-code-form').on('submit', function (e) {
var form = $(this);
var code = $('#couponCode').val();

	$.ajax({
                url: form.attr("action"),
                type: "GET",
                dataType: "json",
                data: form.serialize(),
                success: function(res) {
                    if (res.error && code.toLowerCase() === 'web50') {
  										adoric.trigger('promoCode');
										}
                }
            })


})
}
})();