How to pass Javascript variable with form on submit?
Create a field for that variable, like this:

$form['_my_vars'] = array('#type' =&gt; 'hidden', '#default_value' =&gt; $_my_vars);


Whenever you are changing variable, update field's value.

Do not use 

'#access' =&gt; FALSE


The Form API Reference clarifies it:


  when FALSE, the element is not rendered and the user submitted value is not taken into consideration.