Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Validation - user needs to complete at least one field of a table...

Level 3
Level 3

Hi All

I have a table, which is populated by the user using dropdowns. I have some javascript which auto populates to the right of the users selection.

This all works fine however I now need to add some validation to check that the user has completed at least one field on one line.

The table is below


So the validation (mandatory) needs to error unless at least one field is populated (in the dropdown section ie not 'Notes' or 'Date')

The pdf can be found here:

Dropbox - 207 For Forum.pdf

Any suggestions on the best method / cleanest code to make this happen?



1 Reply
Level 7
Level 7

I suggest a Boolean called complete initialized to false, then loop through the fields in the right column (3 months) and if the field is not null, set the bool to true. Then check the bool and if it's true, you know at least one thing was filled in.

var complete = false;

//since you named all of the cells individually, we just have to look through each one.

if (!FinanceImpact7.isNull) complete = true;

if (!HealthSafetyImpact7.isNull) complete = true;


if (!ReputationSatekholders7.isNull) complete = true;

if (complete) {

  //do whatever you would if it's complete


else {

  //do whatever you would do if it is NOT complete