Declaring a variable instantiated (global only for the form)

how can i declare a variable instantiated only for current form . ([v_global] for form A)

I have a problem i have some forms with the same name for variable [form_type]
so when a user enter a form A [form_type] is set to “A”, if enter to form B [form_type] is set to “B” and so…

the problem is that [form_type] get last value from last form.

if the user open form A in a page y open form B in other page, the variable is set [form_type] = “B” (las form opened).
when back to form A the variable = “B” and not “A”.

i use this variable gobal for a field type select and other proccess.

i tryied with an field type attribute, but it do not works for fields type select.

so, that the question is: how can i declare a variable instantiated only for current form.?