Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

jquery form submit / validate

  • 08-05-2009 10:50am
    #1
    Registered Users, Registered Users 2 Posts: 8,070 ✭✭✭


    using
    http://bassistance.de/jquery-plugins/jquery-plugin-validation/


    [PHP]
    <script type="text/javascript">
    jQuery.validator.setDefaults({
    debug: true,
    success: "valid"
    });;



    $(document).ready(function(){
    $("#form").validate({
    rules: {
    email:{required: true,email: true},
    phone:{required: true,digits: true},
    fname:{required: true}
    },

    submitHandler: function() {
    $("#form").submit();
    }

    });
    });

    </script>
    then


    <form name="form" id="form" method="POST" action="comp.php">

    ETC
    ETC

    submit button
    [/PHP]

    basically if i sub $("#form").submit(); with ALERT, it alerts me , so not sure how i can submit form after validation ?

    thanks


Comments

  • Registered Users, Registered Users 2 Posts: 6,571 ✭✭✭daymobrew


    The docs mention recursion - I think that your $("#form").submit(); is causing this.
    Try changing your submitHandler to:
    [php] submitHandler: function(form) {
    form.submit();
    }[/php]


  • Registered Users, Registered Users 2 Posts: 8,070 ✭✭✭Placebo


    thanks day
    i got it working, by just removing the submit function completely.


Advertisement