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.
Best Answer
What @Ruben mentions is correct.
Still. I believe that you can achieve what you want because you do NOT actually want to hide the field.
Frankly, I do NOT see a need to hide the fields from your users.
You mention:
Assuming I read your question correctly, the following could be the solution to your problem.
How to prevent users from altering a prefilled question/field
or How to "hide" a prefilled question
A very simple solution.