I want to pass a variable created with Javascript to $form_state so that I can use this variable in the form_submit function.
In an ajaxified form I can use:
Drupal.ajax[ajax_el].options.data._my_vars = JSON.stringify(js_object);
But how can I accomplish it in a non ajax form? Is there another possibility than using a hidden field? It might be possible to pass it to a field with #access => FALSE?
I would welcome every advice. Many thanks!
Daniel
#attachJS settings. This is how the#statesdata get passed during Ajax calls.$form['#attached']['js']['my_key'] = array( 'data' => array('my_key' => $settings), 'type' => 'setting' );. How can I pass a variable generated with JS to the server with the settings?