Hi everyone.....
Immediately apologize: to be a lot of code…

I have a form to add users:
<form action="http://localhost/ci_doctrine/signup/submit";
method="post" id="myForm">

<p><label for="username">Username: <em></em></label>
<input type="text" name="username" value="" id="username"  />   </p>

<p><label for="password">Password: <em></em></label>
<input type="password" name="password" value="" id="password"  />       </p>

<p><label for="passconf">Confirm Password: <em></em></label>
<input type="password" name="passconf" value="" id="passconf"  />       </p>

<p><label for="email">E-mail: <em></em></label>
<input type="text" name="email" value="" id="email"  /> </p>

<p><input type="submit" name="submit" value="Create my account"  />     </
p>
</form>

Nothing special…

Respectively included:
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
<script type="text/javascript" src="js/signup.js"></script>

And my js-file signup.js
$(document).ready(
    function()
    {
        var options = {
            timeout: 3000,
            clearForm: true,
            success: function(data) {
                        $("#output").text(data);
                     }

        };

        $("#myForm").validate({
                submitHandler: function(form) {
                    $(form).ajaxSubmit(options);
                },
                debug: true,
                focusInvalid: false,
                focusCleanup: true,
                rules: {
                    username: {
                        required: true,
                        minlength: 6,
                        maxlength: 12,
                        remote: {
                            url: "userCheck/",
                            type: "post",
                            data: {
                              username: function() {
                                return $("#username").val();
                              }
                            }
                        }

                    },
                    password: {
                        required: true,
                        rangelength: [6, 24]
                    },
                    passconf: {
                        required: true,
                        rangelength: [6, 24],
                        equalTo: "#password"
                    },
                    email: {
                        required: true,
                        email: true
                    }
                },
                messages: {
                      <some messages>
                },
                errorPlacement: function(error, element) {
                    var er = element.attr("name");
                    error.appendTo( element.parent().find("label
[for='" + er + "']").find("em") );

        });
    }
 );
The problem is that when I click the submit button that runs a script
"usercheck" from remote rule. I see it in Firebug. And nothing is
added to the database.
How can now send data to the server? Why doesn’t work submitHandler??

Thanks for any help

Reply via email to