Fix for preview button code in multi-step user register form via hook_form_alter

  1. // copied below code from the print_r of a node_add form
  2.  
  3. // i want to add a PREVIEW button to the user/register page, next to the
  4.  
  5. // my issue is if I just add this code to the user/register form via hook_form_alter, what additional code will this take to make it work as expected, if i'm doing multi-step user registration & ONLY want this button on the last page of the multi-step form?
  6.  
  7.  
  8.             [preview] => array
  9.                 (
  10.                     [#type] => submit
  11.                    [#value] => Preview
  12.                    [#weight] => 10
  13.                    [#submit] => array
  14.                        (
  15.                             [0] => node_form_build_preview
  16.                         )
  17.  
  18.                     [#post] => array
  19.                        (
  20.                         )
  21.  
  22.                     [#programmed] =>
  23.                    [#tree] =>
  24.                    [#parents] => array
  25.                        (
  26.                             [0] => preview
  27.                         )
  28.  
  29.                     [#array_parents] => array
  30.                        (
  31.                             [0] => buttons
  32.                             [1] => preview
  33.                         )
  34.  
  35.                     [#processed] => 1
  36.                    [#description] =>
  37.                    [#attributes] => array
  38.                        (
  39.                         )
  40.  
  41.                     [#required] =>
  42.                    [#input] => 1
  43.                    [#name] => op
  44.                    [#button_type] => submit
  45.                    [#executes_submit_callback] => 1
  46.                    [#process] => array
  47.                        (
  48.                             [0] => form_expand_ahah
  49.                         )
  50.  
  51.                     [#id] => edit-preview
  52.                    [#defaults_loaded] => 1
  53.                    [#sorted] => 1
  54.                )

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.