@@ -92,6 +92,7 @@ function onBillingProjectChange() {
92
92
//reset as medium prize
93
93
resetSoftwarePrizes ( ) ;
94
94
}
95
+
95
96
}
96
97
97
98
function validateFieldsContestSelection ( ) {
@@ -189,6 +190,12 @@ function validateFieldsContestSelectionAlgorithm() {
189
190
errors . push ( 'The registration end date should be before or equal the end date.' ) ;
190
191
}
191
192
193
+ // trial billing selected: groups should exist
194
+ if ( $ ( '#billingProjects' ) . val ( ) === TRIAL_BILLING_ID &&
195
+ jQuery_1_11_1 ( "#groups" ) . magicSuggest ( ) . getValue ( ) . length < 1 ) {
196
+ errors . push ( 'For trial billing account, at least one group should be selected' ) ;
197
+ }
198
+
192
199
if ( errors . length > 0 ) {
193
200
showErrors ( errors ) ;
194
201
return false ;
@@ -294,7 +301,11 @@ function validateFieldsContestSelectionSoftware() {
294
301
errors . push ( 'Submission end date/time should be larger than Start date/time.' ) ;
295
302
}
296
303
}
297
-
304
+ // trial billing selected: groups should exist
305
+ if ( $ ( '#billingProjects' ) . val ( ) === TRIAL_BILLING_ID &&
306
+ jQuery_1_11_1 ( "#groups" ) . magicSuggest ( ) . getValue ( ) . length < 1 ) {
307
+ errors . push ( 'For trial billing account, at least one group should be selected' ) ;
308
+ }
298
309
if ( errors . length > 0 ) {
299
310
showErrors ( errors ) ;
300
311
return false ;
@@ -468,7 +479,11 @@ function validateFieldsContestSelectionStudio() {
468
479
if ( startDate . getTime ( ) - getServerTime ( ) . getTime ( ) < 4 * 60 * 60 * 1000 ) {
469
480
errors . push ( 'Start time can\'t be less than within 4 hours' ) ;
470
481
}
471
-
482
+ // trial billing selected: groups should exist
483
+ if ( $ ( '#billingProjects' ) . val ( ) === TRIAL_BILLING_ID &&
484
+ jQuery_1_11_1 ( "#groups" ) . magicSuggest ( ) . getValue ( ) . length < 1 ) {
485
+ errors . push ( 'For trial billing account, at least one group should be selected' ) ;
486
+ }
472
487
if ( errors . length > 0 ) {
473
488
showErrors ( errors ) ;
474
489
return false ;
0 commit comments