3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+ declare (strict_types=1 );
7
+
6
8
namespace Magento \SalesRule \Block \Adminhtml \Promo \Quote \Edit \Tab \Coupons ;
7
9
8
10
/**
9
11
* Coupons generation parameters form
10
12
*
11
13
* @author Magento Core Team <core@magentocommerce.com>
14
+ *
15
+ * Class \Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Form
12
16
*/
13
17
class Form extends \Magento \Backend \Block \Widget \Form \Generic
14
18
{
@@ -77,7 +81,8 @@ protected function _prepareForm()
77
81
'label ' => __ ('Coupon Qty ' ),
78
82
'title ' => __ ('Coupon Qty ' ),
79
83
'required ' => true ,
80
- 'class ' => 'validate-digits validate-greater-than-zero '
84
+ 'class ' => 'validate-digits validate-greater-than-zero ' ,
85
+ 'onchange ' => 'window.validateCouponGenerate(this) '
81
86
]
82
87
);
83
88
@@ -91,7 +96,8 @@ protected function _prepareForm()
91
96
'required ' => true ,
92
97
'note ' => __ ('Excluding prefix, suffix and separators. ' ),
93
98
'value ' => $ couponHelper ->getDefaultLength (),
94
- 'class ' => 'validate-digits validate-greater-than-zero '
99
+ 'class ' => 'validate-digits validate-greater-than-zero ' ,
100
+ 'onchange ' => 'window.validateCouponGenerate(this) '
95
101
]
96
102
);
97
103
@@ -103,7 +109,8 @@ protected function _prepareForm()
103
109
'name ' => 'format ' ,
104
110
'options ' => $ couponHelper ->getFormatsList (),
105
111
'required ' => true ,
106
- 'value ' => $ couponHelper ->getDefaultFormat ()
112
+ 'value ' => $ couponHelper ->getDefaultFormat (),
113
+ 'onchange ' => 'window.validateCouponGenerate(this) '
107
114
]
108
115
);
109
116
@@ -138,7 +145,8 @@ protected function _prepareForm()
138
145
'title ' => __ ('Dash Every X Characters ' ),
139
146
'note ' => __ ('If empty no separation. ' ),
140
147
'value ' => $ couponHelper ->getDefaultDashInterval (),
141
- 'class ' => 'validate-digits '
148
+ 'class ' => 'validate-digits ' ,
149
+ 'onchange ' => 'window.validateCouponGenerate(this) '
142
150
]
143
151
);
144
152
0 commit comments