You are viewing limited content. For full access, please sign in.

Question

Question

error message for weekdays in table

asked on March 29, 2022

I'm creating a form for timesheets, and I'd like for an error message to appear when an entire row is left blank/ not filled out. Essentially there are various time blocks to use (regular, over time, sick time, vacation time etc) where no particular item is specifically mandatory, but if none are filled out it's likely an error in filling out the form and therefore I'd like a error message to appear. 

I'm attempting to do this via Field Rules that show a HTML block with an error message, but I've been unsuccessful as I want it to be specific to a particular row (each row is represented by a day). So if none of the items are selected in the row, the error message appears. I'm open to any ideas on how to get this rolling. 

Here's what the table looks like so far: 

 

0 0

Replies

replied on March 29, 2022

Hi Catherine-

This one caught my eye, and then ended up being a bit trickier than I expected. Also, it's entirely possible that I'm overthinking it and there's an easier way, but here's what I came up with:

  1. Add another column that will sum up the hours entered. I named mine Total. I don't think it matters much, but I used a text field rather than number.
  2. Set a field calculation to sum up all of the time columns for that row. Here's an example with just two columns:
    =SUM(INDEX(File_Table.Regular,ROW()),INDEX(File_Table.Flex,ROW()))
  3. This one is a bit goofy. I had originally tried to use required field logic and SUMIF to flag an empty field, but it always ends up with a zero in the total column. So, I used a regular expression to say that the field must have a value other than 0:
    [^0]
  4. Finally, I used a custom error message to say something better than "Invalid Field"

 

0 0
replied on April 5, 2022

although that works, I'm very reluctant to add another column to my very large table, I'm not even sure you could read everything if I added one more. Is there a way to add and error message at the bottom before submission? Maybe this column can exist but is hidden? 

0 0
replied on April 5, 2022

Sure, you can hide that column and then do some logic on it. As a simple option, I hid it and then put another field underneath that displays if the hidden total field = 0.

The reason the Error field is read only and required is to disallow form submission. There are other ways to handle it, or you can use CSS to hide the input box. Basically, this is a proof of concept and there are various ways to make it a bit nicer.

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.