<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-15"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ivan Sergio Borgonovo ha scritto:
<blockquote cite="mid:20080103175238.2d647f12@webthatworks.it"
 type="cite">
  <pre wrap="">On Thu, 03 Jan 2008 17:17:51 +0100
Davide Michel 'ZioBudda' Morelli <a class="moz-txt-link-rfc2396E" href="mailto:michel@ziobudda.net">&lt;michel@ziobudda.net&gt;</a> wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi all. I want to modify the user registration in 2+ steps or
better: I want that the form that new user use for registration
(/user/register) is splitted in 2+ page.  This because via profile
module I have added 15 new field.

I know that I can write a form splitted in 2 page (I read "Pro
Drupal Development), but I don't want to create the register form
from zero.  I have tried to delete the $form['#submit'] value via
hook_form() but with no results. Is there a way to do this without
create a new module for user_register ?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
What about alter_form + a redirect to another piece of registration?
  </pre>
</blockquote>
It does not work. I don't know why, but user_register function is
called with or without other "validation". <br>
<br>
<blockquote cite="mid:20080103175238.2d647f12@webthatworks.it"
 type="cite">
  <pre wrap="">But well no luck if you plan to still use profile.module and avoid to
write your own module.
  </pre>
</blockquote>
Why this ? If I use profile.module I use core Drupal with a form/admin
page where I can insert new item without modify php code lines (if I
use my module). <br>
<blockquote cite="mid:20080103175238.2d647f12@webthatworks.it"
 type="cite">
  <pre wrap="">
My main concern about approaching this problem this way would be to
deal with core in a way that in the future may not be considered
kosher or break up once you add other modules etc...

  </pre>
</blockquote>
However this is my alter_form function: <br>
<br>
function mw_ur_form_alter($form_id,&amp;$form) {<br>
    if ($form_id == 'user_register') {<br>
        //print_r($form);<br>
        if (!isset($form['#post']['step'])) {<br>
            $form['#multistep'] = TRUE;<br>
              $form['#tree'] = TRUE;<br>
            $form['#redirect'] = FALSE;<br>
              $form['step'] = array  (<br>
                '#type' =&gt; 'hidden',<br>
                '#value' =&gt; 1<br>
            );<br>
            unset($form['Informazioni personali']);<br>
            $form['submit'] = array(<br>
                '#value' =&gt; 'next',<br>
                '#type' =&gt; 'submit',<br>
                '#weight' =&gt; 30<br>
            );<br>
        } else {<br>
            /*<br>
            $form['#multistep'] = TRUE;<br>
            $form['#tree'] = TRUE;<br>
            $form['#redirect'] = FALSE;<br>
            $form['account']['name']['#default_value'] =
$form['#post']['account']['name'];<br>
            $form['account']['mail']['#default_value'] =
$form['#post']['account']['mail'];<br>
            */<br>
            unset ($form['Residenza']);           <br>
        }<br>
        /**<br>
         * only for test<br>
         */<br>
        /*foreach($form as $key =&gt; $value) {<br>
            print("-".$key."-&lt;br&gt;");<br>
        }*/<br>
<br>
    }<br>
}<br>
<br>
Now my problem is this: I compile the "username and mail field" (only
items required) then I click on the "next" button and I get the same
page (ok, this is correct) but with  username and email field  empty
and an error messagge that say me that username and mail filed must be
non-empty. If I see the $form values via print_r() I can see that the
$form['post'] are not empty (see my else code).<br>
<br>
M.<br>
<pre class="moz-signature" cols="72">-- 
Michel 'ZioBudda' Morelli                       <a class="moz-txt-link-abbreviated" href="mailto:michel@ziobudda.net">michel@ziobudda.net</a>
Consulenza sistemistica in ambito OpenSource.
Sviluppo applicazioni web dinamiche (LAMP+Ajax)
Telefono: 0200619074
Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

<a class="moz-txt-link-freetext" href="http://www.ziobudda.net">http://www.ziobudda.net</a>                         ICQ: 58351764  
<a class="moz-txt-link-freetext" href="http://www.ziobuddalabs.it">http://www.ziobuddalabs.it</a>                      Skype: zio_budda
<a class="moz-txt-link-freetext" href="http://www.ajaxblog.it">http://www.ajaxblog.it</a>                                MSN: <a class="moz-txt-link-abbreviated" href="mailto:michel@ziobuddalabs.it">michel@ziobuddalabs.it</a>                   
                                                JABBER: <a class="moz-txt-link-abbreviated" href="mailto:michel@gmail.com">michel@gmail.com</a>
</pre>
</body>
</html>