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 8060653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:04:03+00:00 2026-06-05T10:04:03+00:00

How would I add additional functionality to the jQuery validation submitHandler that is set

  • 0

How would I add additional functionality to the jQuery validation submitHandler that is set in another script? I cannot modify the source JavaScript that is defining the submitHandler in the first place. Instead, I need to add some additional functionality to it from a subsequent script that runs. Here is some scaled-down pseudo-code for the .js file that is defining the submitHandler in the first place–which I cannot directly modify:

$("#frmReg").validate({
    invalidHandler: function(e, validator) { //code here ... not relevant },
    submitHandler: function() {
        window.onbeforeunload = null;
        $('#myForm')[0].submit();             
    },
    rules: { firstname: { required: true } },
    messages: { firstname: { required: 'First name is required' } }
});

Essentially, I want to bind a second function to the existing submitHander.

  • 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-05T10:04:05+00:00Added an answer on June 5, 2026 at 10:04 am

    I glanced over the source and I think this should work:

    var validatorInstance = $("#frmReg").validate(), //Call this AFTER the initial registration,
        submitHandler = validatorInstance.settings.submitHandler;
    
    validatorInstance.settings.submitHandler = function(){
        //Do your custom stuff here
        console.log(true);
        return submitHandler.apply(this,arguments); //forward to the old handler
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering if anyone knows a java script library that would add a
I have a class that uses an add-on template to add additional functionality as
I would like to add an additional parameter in my url, the use case
I installed FOSUserBundle and i would like to add any additional role, such ROLE_NEW.
I'd like to write a gmail extension that would add a button on the
How would I add a custom meta box to my Wordpress theme that allows
I have a nice default-value check going and client wants to add additional functionality
I have a file field in Drupal 7 that I need to add additional
I'm trying to add some additional functionality to an API. However, I'd like these
I have an existing toolbar and would like to add tabs to it that

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.