Question

Validation off/on

  • 19 April 2023
  • 4 replies
  • 54 views

Badge +1

I have a large form separated by panels with validations in each. I have a rule for validation based on selection in a choice control (Full or Modified). This is working to stop the validation in the panels when they are not required but how do i get the validation to occur when submitting the panels that are required?

If(Array.isArray(ModifiedprogramWHS),length(ModifiedprogramWHS),If(length(ModifiedprogramWHS)>0,1,0))<10 &&TrainingProgram=="Modified"

 


4 replies

Userlevel 5
Badge +14

Screenshots would be incredibly helpful in understanding what it is you have going on.

 

how do i get the validation to occur when submitting the panels that are required?

 

When you submit the form, it *should* validate using all of your validation rules. Is this not the case? 

Badge +1

i have changed the validation rule successfully to sit on a JavaScript button for the ‘Next’ page. The button now hides if the panel is not completed. 

If(Array.isArray(Collectorhasreviewed),length(Collectorhasreviewed),If(length(Collectorhasreviewed)>0,1,0))<7

The problem i face now is the next page consists of 12 different versions of the above and when i place that as a rule in the button it stops the whole form from creating.

If (
  (Array.isArray(Week1Orientation) ? Week1Orientation.length : (Week1Orientation ? 1 : 0)) < 17 &&
  (Array.isArray(W1Q2) ? W1Q2.length : (W1Q2 ? 1 : 0)) < 2 &&
  (Array.isArray(Week1TrainingReading) ? Week1TrainingReading.length : (Week1TrainingReading ? 1 : 0)) < 5 &&
  (Array.isArray(Week1TrainingWorkplaceHealthandSafety) ? Week1TrainingWorkplaceHealthandSafety.length : (Week1TrainingWorkplaceHealthandSafety ? 1 : 0)) < 14 &&

  (Array.isArray(Week1TrainingObservationofVenepuncture) ? Week1TrainingObservationofVenepuncture.length : (Week1TrainingObservationofVenepuncture ? 1 : 0)) < 31 &&

  (Array.isArray(Week1TrainingSpecialRequests) ? Week1TrainingSpecialRequests.length : (Week1TrainingSpecialRequests ? 1 : 0)) < 4 &&

  (Array.isArray(Week1TrainingPracticaleCollectTraining) ? Week1TrainingPracticaleCollectTraining.length : (Week1TrainingPracticaleCollectTraining ? 1 : 0)) < 5 &&

  (Array.isArray(Week1TrainingCustomerServices) ? Week1TrainingCustomerServices.length : (Week1TrainingCustomerServices ? 1 : 0)) < 15 &&

  (Array.isArray(Week1TrainingInstructiononTelephone) ? Week1TrainingInstructiononTelephone.length : (Week1TrainingInstructiononTelephone ? 1 : 0)) < 2 &&

  (Array.isArray(Week1TrainingBilling) ? Week1TrainingBilling.length : (Week1TrainingBilling ? 1 : 0)) < 5 &&
  (Array.isArray(Week1TrainingCollectionofNonBloods) ? Week1TrainingCollectionofNonBloods.length : (Week1TrainingCollectionofNonBloods ? 1 : 0)) < 13 &&

  Assessment1date < dateAddDays(Date, 7) &&
  isNullOrEmpty({Self})
) {
}

Userlevel 6
Badge +22

HI,

I am no Javascript programmer but I do not know Nintex forms.

If a form does not open or remains white after adding custom Javascript it is because the Javascript has bad syntax in it. Maybe check the browser development tools when opening the form to try find the code error. It could be something as simple as a missing parentheses or the open curly brackets you have at the end of your code. 

 

Userlevel 5
Badge +20

Hi @ajb8 
Did you resolve your issue?

Reply