My question is basically the same as this one asked on StackOverflow, too old to migrate, but which seems to be a better fit here.
This answer (more authoritatively, here) suggests a way to add a visible field to a form and set its default value, but I'd like to then make that field hidden to help not confuse people who are filling out the form.
This question suggests a couple failed strategies to get hidden items, such as prefilling a deleted question or skipped page. I have a single-page form and for UX reasons need to keep it that way.
This snippet suggests it's possible but doesn't say how.