File tree 3 files changed +22
-2
lines changed
3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -132,3 +132,4 @@ Summary,Summary
132
132
"Allow Guests to Write Reviews","Allow Guests to Write Reviews"
133
133
Active,Active
134
134
Inactive,Inactive
135
+ "Please select one of each of the ratings above.","Please select one of each of the ratings above."
Original file line number Diff line number Diff line change 35
35
id="<?= $ block ->escapeHtmlAttr ($ _rating ->getRatingCode ()) ?> _<?= $ block ->escapeHtmlAttr ($ _option ->getValue ()) ?> "
36
36
value="<?= $ block ->escapeHtmlAttr ($ _option ->getId ()) ?> "
37
37
class="radio"
38
- data-validate="{required:true, messages:{ required:'Please select one of each of the ratings above.'} }"
38
+ data-validate="{ 'rating- required':true }"
39
39
aria-labelledby="<?= $ block ->escapeHtmlAttr ($ _rating ->getRatingCode ()) ?> _rating_label <?= $ block ->escapeHtmlAttr ($ _rating ->getRatingCode ()) ?> _<?= $ block ->escapeHtmlAttr ($ _option ->getValue ()) ?> _label" />
40
40
<label
41
41
class="rating-<?= $ block ->escapeHtmlAttr ($ iterator ) ?> "
85
85
"Magento_Ui/js/core/app": <?= /* @noEscape */ $ block ->getJsLayout () ?>
86
86
},
87
87
"#review-form": {
88
- "Magento_Review/js/error-placement": {}
88
+ "Magento_Review/js/error-placement": {},
89
+ "Magento_Review/js/validate-review": {}
89
90
}
90
91
}
91
92
</script>
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ define ( [
7
+ 'jquery' ,
8
+ 'jquery/ui' ,
9
+ 'jquery/validate' ,
10
+ 'mage/translate'
11
+ ] , function ( $ ) {
12
+ 'use strict' ;
13
+
14
+ $ . validator . addMethod (
15
+ 'rating-required' , function ( value ) {
16
+ return value !== undefined ;
17
+ } , $ . mage . __ ( 'Please select one of each of the ratings above.' ) ) ;
18
+ } ) ;
You can’t perform that action at this time.
0 commit comments