33 * Copyright © Magento, Inc. All rights reserved.
44 * See COPYING.txt for license details.
55 */
6+ declare (strict_types=1 );
7+
68namespace Magento \SalesRule \Block \Adminhtml \Promo \Quote \Edit \Tab \Coupons ;
79
810/**
911 * Coupons generation parameters form
1012 *
1113 * @author Magento Core Team <core@magentocommerce.com>
14+ *
15+ * Class \Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Form
1216 */
1317class Form extends \Magento \Backend \Block \Widget \Form \Generic
1418{
@@ -77,7 +81,8 @@ protected function _prepareForm()
7781 'label ' => __ ('Coupon Qty ' ),
7882 'title ' => __ ('Coupon Qty ' ),
7983 'required ' => true ,
80- 'class ' => 'validate-digits validate-greater-than-zero '
84+ 'class ' => 'validate-digits validate-greater-than-zero ' ,
85+ 'onchange ' => 'window.validateCouponGenerate(this) '
8186 ]
8287 );
8388
@@ -91,7 +96,8 @@ protected function _prepareForm()
9196 'required ' => true ,
9297 'note ' => __ ('Excluding prefix, suffix and separators. ' ),
9398 'value ' => $ couponHelper ->getDefaultLength (),
94- 'class ' => 'validate-digits validate-greater-than-zero '
99+ 'class ' => 'validate-digits validate-greater-than-zero ' ,
100+ 'onchange ' => 'window.validateCouponGenerate(this) '
95101 ]
96102 );
97103
@@ -103,7 +109,8 @@ protected function _prepareForm()
103109 'name ' => 'format ' ,
104110 'options ' => $ couponHelper ->getFormatsList (),
105111 'required ' => true ,
106- 'value ' => $ couponHelper ->getDefaultFormat ()
112+ 'value ' => $ couponHelper ->getDefaultFormat (),
113+ 'onchange ' => 'window.validateCouponGenerate(this) '
107114 ]
108115 );
109116
@@ -138,7 +145,8 @@ protected function _prepareForm()
138145 'title ' => __ ('Dash Every X Characters ' ),
139146 'note ' => __ ('If empty no separation. ' ),
140147 'value ' => $ couponHelper ->getDefaultDashInterval (),
141- 'class ' => 'validate-digits '
148+ 'class ' => 'validate-digits ' ,
149+ 'onchange ' => 'window.validateCouponGenerate(this) '
142150 ]
143151 );
144152
0 commit comments