@@ -92,6 +92,7 @@ function onBillingProjectChange() {
9292 //reset as medium prize
9393 resetSoftwarePrizes ( ) ;
9494 }
95+
9596}
9697
9798function validateFieldsContestSelection ( ) {
@@ -189,6 +190,12 @@ function validateFieldsContestSelectionAlgorithm() {
189190 errors . push ( 'The registration end date should be before or equal the end date.' ) ;
190191 }
191192
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+
192199 if ( errors . length > 0 ) {
193200 showErrors ( errors ) ;
194201 return false ;
@@ -294,7 +301,11 @@ function validateFieldsContestSelectionSoftware() {
294301 errors . push ( 'Submission end date/time should be larger than Start date/time.' ) ;
295302 }
296303 }
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+ }
298309 if ( errors . length > 0 ) {
299310 showErrors ( errors ) ;
300311 return false ;
@@ -468,7 +479,11 @@ function validateFieldsContestSelectionStudio() {
468479 if ( startDate . getTime ( ) - getServerTime ( ) . getTime ( ) < 4 * 60 * 60 * 1000 ) {
469480 errors . push ( 'Start time can\'t be less than within 4 hours' ) ;
470481 }
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+ }
472487 if ( errors . length > 0 ) {
473488 showErrors ( errors ) ;
474489 return false ;
0 commit comments