Custom hidden fields on forms across sub pages

I’m trying to add a hidden field to show which sub page a specific form a user filled out is attributed to. Currently the form is the same class and applies across all sub pages so the same hidden field value applies. Would a combo class solve this? What’s the best way to do it?