form variables

Would it be possible to give us variables specific to a form (like with methods?)

Thanks

If you do not declare a ‘var’ in a form method it becomes form local.
myformVar = 3; //form local
var myMethodVar =4;//method local

That would be great but:

I also want to use this value to fill a field like with that global.

if you declare a variable in your script without “var” it scopes on solution level.
In other words, it acts as a global, and you can, of course, fill database columns with it.
myColumnFromDatabase = myJavascriptVariable

Does this satisfy your request?

You are right!

I was thinking of oops programming and want(ed) to select the variable and attach it to the field permanently like with a global. That way I can change the variable (like a global) on the fly without changing the content of inidividual fields…