Panel and form data null problem :-(

Panel and form data null problem :-(

Hi Guys,

I'm having a massive issue with a login form within a panel using 1.3.1

When I try to serilaiise the form data is as follows: email=&password=&action=process

Form

  1. <div data-role="panel" data-position="right" data-position-fixed="true" data-display="overlay" data-theme="b" id="add-form">
            <form id="login" class="userform" name="login">
                <h2>Login</h2>
                <div id="errorTxt">&nbsp;</div>
                <label for="email">E-mail:</label>
                <input name="email" id="emailTest" type="text">
                <label for="password">Password:</label>
                <input name="password" ype="password">
                <input type="hidden" name="action" value="process">
                <div class="ui-grid-a">
                    <div class="ui-block-a"><a href="#" data-rel="close" data-role="button" data-theme="c" data-mini="true">Cancel</a></div>
                    <div class="ui-block-b"><a href="#" id="submit" data-role="button" data-theme="b" data-mini="true">Login</a></div>
                </div>
            </form>
        </div>














JS:

  1. $(document).on("pageinit", ".ui-page", function() {
      var $page = $(this);
      var formData = $("#login").serialize();
      $page.find("#submit").click(function(){
        alert(formData);
      });
    });






Is there anything obvious i'm doing wrong. Been staring at this for a few hours now.

Cheers