How to access to node on form_submit I added a button to the page. I'm trying to get the values of the field when I click the button. But I can not understand how to access the node from submit? Am I on the right track or should I look for another solution? I tried to add $node to the function redirect_button_form_submit but this does not work.

function show_on_map_node_view($node, $view_mode, $langcode) {
    $url = url(current_path(), array('absolute' =&gt; TRUE));
  if (($node-&gt;type == 'addproblem') &amp;&amp; (strpos($url, "problem"))) {
    $form = drupal_get_form('redirect_button_form');
    $node-&gt;content['redirect_button'] = $form;
 }
}

function redirect_button_form($form, &amp;$form_submit) {
    $form['submit'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt; t('Show on map'),
    );
    return $form;
}

function redirect_button_form_submit($form, &amp;$form_state) {
//How to access the $node here?

    $geofield = field_get_items('node', $node, 'field_location_exif');
    $location = array(lat =&gt; $geofield[0][lat], lon =&gt; $geofield[0][lon]);
    $path = '&lt;front&gt;';
    $options = array('query' =&gt; $location);
    drupal_goto($path, $options);
}
You can pass the node as an argument to your form builder and store it there.

$form = drupal_get_form('redirect_button_form', $node);


function redirect_button_form($form, &amp;$form_state, $node) {       
    $form['submit'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt; t('Show on map'),
    );

    return $form;
}


function redirect_button_form_submit($form, &amp;$form_state) {
    $node = $form_state['build_info']['args'][0];

    $geofield = field_get_items('node', $node, 'field_location_exif');
    $location = array(lat =&gt; $geofield[0][lat], lon =&gt; $geofield[0][lon]);
    $path = '&lt;front&gt;';
    $options = array('query' =&gt; $location);
    drupal_goto($path, $options);
}


drupal_get_form can take additional arguments besides $form_id.


  Any additional arguments are passed on to the functions called by
  drupal_get_form(), including the unique form constructor function. For
  example, the node_edit form requires that a node object is passed in
  here when it is called.


Also, to do a form redirect you can use:

$form_state['redirect'] = path...

Instead of drupal_goto which should not be used here.


  When $form_state['redirect'] is an array it should be populated with
  arguments appropriate for drupal_goto() - which is to say, the second
  element in the array can itself be an array holding all the properties
  expected by url()'s $options argument, including fragment, query,
  absolute, etc.