title: How do you do jquery serialize with CodeIgniter?
body: <p>I'm using jQuery and CodeIgniter to do this. Ok so basically I have a register form which asks the user for a username, password, and email. Once the form is submitted, jQuery would serialize the form and give it to a process page, echo the value out in the controller, and then the javascript would alert the post values in the original view. So far it isn't working. Nothing is being alerted. Here's my code:</p>
  
  <p>(The controller)
  register.php:</p>
  
  <pre><code>    &lt;?php if (!defined('BASEPATH'))
          exit('No direct script access allowed');
  
      class Register extends CI_Controller
      {
          public function step1()
          {
          $this-&gt;load-&gt;view('registration_step1');
          }
          public function step1_process(){
          var_dump($_POST);
          }
          public function step2()
          {
          $this-&gt;load-&gt;view('registration_step2');
          }
          public function step3()
          {
          $this-&gt;load-&gt;view('registration_step3');
          }
      }
  </code></pre>
  
  <p>(Portion of the view)
  registration_step1.php:</p>
  
  <pre><code>        &lt;form style="margin-top: 100px;" class="registerbox"&gt;
          &lt;h2&gt;User Info:&lt;/h2&gt;
          &lt;input type="text" name="username" placeholder="Username" style="height:35px; width: 300px;font-size:20px;"/&gt; &lt;br /&gt;
          &lt;input type="text" name="email" placeholder="Email" style="height:35px; width: 300px;font-size:20px;"/&gt;&lt;br /&gt;
          &lt;input type="password" name="password" placeholder="Password" style="height:35px; width: 300px;font-size:20px;"/&gt;&lt;br /&gt;
          &lt;input type="submit" class="btn btn-success" style="height:35px; width: 310px;font-size:20px;margin-bottom:5px;" value="Next &amp;raquo;"/&gt;&lt;br /&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>(javascript) registration.js:</p>
  
  <pre><code>     $(document).ready(function() {
          $(".registerbox").submit(function() { 
                var userinfo = $(".registerbox").serialize();
                return false;
                 $.post("register/step1_process", {
                 userinfo : userinfo
                },
              function(data) {
                  alert(data);
              });
          });
       });
  </code></pre>