Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8379659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:14:59+00:00 2026-06-09T16:14:59+00:00

Guys this is my first question. I have a table which displays the students

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:15:01+00:00Added an answer on June 9, 2026 at 4:15 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HI Guys, I have created a windows service which spawns three threads.The first thread
Hey guys, quick question, just trying to filter a user's first and last name
I have this line of jQuery: $(#colorimage).css('background','url(images/bw.jpg)'); First question: the way that this is
Hi guys this is my first question and i guess can be easy for
This is my first step to programming.guys your help hands required.I watched youtube video
hey guys having this really simple problem but cant seem to figure out have
guys I know this question is very basic but I've met in few publications
Hi this question or problem i have its very hard i have search and
Hey guys. I have a question. I have two different arrays with different structure
First of all, I'm sorry about the feedback-nature of this question. I'm trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.