Expand my Community achievements bar.

SOLVED

Tables: Need to have Text Box Message appear if Totals don't agree

Avatar

Former Community Member

I have a table that has six columns of numbers. Each column is totaled. I would like to get an text box ("These totals must agree") to appear IF (Column Mice + Column Rats) is NOT equal to (Column B + Column C + Column D + Column E.)

I do not need to sum the totals of any of the columns, that is to say, I do not need to know the total of mice plus rats, etc. I just to make sure that the numbers of rats and mice are equal to the number of category B, C, D and E animals. And to let the form user know it.

Hope this makes sense!

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 6

There are a couple of ways to handle this.  Normally validation of this type is done when the user is finished filling out the form and is ready to submit it.  This is because in this case the validation is based on several columns and rows, so if you wanted a pop-up message box for the error, they would get a message popping up every time a number is entered until all of the columns add up properly.

It doesn't look like your form has any sort of submit function, so I took a stab at another way.  I added a message which is both a note and a warning below the category list.  This is normally visible, and is hidden when the columns add up properly.  I added the validation code to the JustifyE layout:ready event since it was already being used for other script and it fires when you need it.

Updated form is attached.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 6

There are a couple of ways to handle this.  Normally validation of this type is done when the user is finished filling out the form and is ready to submit it.  This is because in this case the validation is based on several columns and rows, so if you wanted a pop-up message box for the error, they would get a message popping up every time a number is entered until all of the columns add up properly.

It doesn't look like your form has any sort of submit function, so I took a stab at another way.  I added a message which is both a note and a warning below the category list.  This is normally visible, and is hidden when the columns add up properly.  I added the validation code to the JustifyE layout:ready event since it was already being used for other script and it fires when you need it.

Updated form is attached.

Avatar

Former Community Member

Alas! The file is still queued. Waiting anxiously to see the solution...