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

Question

Question

Ignore Hidden Fields with JavaScript?

asked on January 31, 2024

I am hiding certain form fields with JavaScript.

How can I also ignore those hidden fields with JavaScript?

NOTE:  the form I'm working with previously had 100+ FIELD RULES and it was impacting page load, so I'm now hiding the fields with JavaScript.  It's very snappy now, but I don't want hidden field values to store as variables.  I need blank variables for hidden fields.

Thank you for your help!

0 0

Replies

replied on January 31, 2024

If you don't want the values to be stored, then I would recommend using Field Rules over Javascript or CSS to hide them, since it has the built-in functionality to choose to ignore or save the values.

Could you move all of the hidden fields into a single section, and then use a single Field Rule to hide the whole section?

1 0
replied on February 1, 2024

I see what you're saying.  I can't hide them all in one section.  It's an inspection form.  If an inspection item fails, the State Code governing that item appears on the form.  If it passes, the State Code stays hidden. There are over 100 inspection items & corresponding State Codes.

0 0
replied on February 1, 2024

You could have some Javacript that runs upon form submission, or a workflow that runs in-between tasks in your process, that goes through all of those fields and clears out their values.

But note that will be a different result that the Field Rules would have caused.  With the field rules ignoring the field, it isn't populated at all, so there is a NULL value in the field, nothing in it.  But using Javascript or Workflow to empty those fields will result in the fields being populated with blank values instead of a NULL value.

Where this could be a particular problem is if you have another task later in your process that uses those fields again, and perhaps has calculations or lookups for them.  It's possible those won't work on the later task because the form doesn't see the field as empty and needing to be processed.  I can't say for sure that is what will happen, but I can say to a computer, a NULL value and an empty string or field is not the same thing.

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

Sign in to reply to this post.