Ajax提交没有正确发生

Guys this is my first question. I have a table which displays the students name and the input fields to enter their exam marks. The table header shows the subjects(its in a while loop) and has an input field to enter max marks for all of them. This max marks is updated thru Ajax. Its not happening properly. If we press submit first time, nothing will happen. If we press submit second time, it submits. If we press third time, it updates twice, if we press fourth time, it updates thrice (the success message shows thrice) Code -

<script>
$(document).ready(function(){
$("#maxmarks<?php echo "$m";?>").validate({

    rules:{

        maxmarks:{

        number: true,

        }

    },
    messages:{

        maxmarks:{

            number: "Please enter a valid marks",

        }

    },
    submitHandler: function(form){

        $("#maxmarks<?php echo "$m";?>").submit(function(){

            $.ajax({

                url : 'components/teacher/performance/maxupdate.php', 
                type : 'POST', 
                data : $("#maxmarks<?php echo "$m";?>").serialize(),
                success : function(res){

                    $('#resultreturn').prepend(res);

                }
            });
            return false;
        }); 

    }                 
 });
 });
 </script>

The form has the same id as the script above. Can someone tell me what is the problem?

You have the submit handler twice. Once as submitHandler:, then you do it again as .submit()

One or the other - not both.

The first time the form is submitted it creates the submit handler (as you told it to with .submit()) but doesn't actually run it.

The second time it runs it (since you created it earlier), and then creates it again. Each time you run it you get more of them.