Easy way to define variables over forms

Easy way to define variables over forms

I have a few variables that are defined under inputs, however, these variables are not defined over the entire form. Although it is possible using another input field, I really don't want to have multiple disabled inputs for no reason. I want to define a variable over the entire form. Is this possible?
I tried the defining global variable help, but I don't think that solves my issue.

My script is basically:
a = productDet.get("Reimbursement");
which is inside for/if loops under a specific user input (a has the correct value)

I want to use the "a" variable in another field under another input. (same form)

Thanks