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

  • Home
  • SEARCH
  • 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 7715797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:28:36+00:00 2026-06-01T02:28:36+00:00

I disabled the click event of image using unbind method. But I don’t know

  • 0

I disabled the click event of image using unbind method. But I don’t know how to recover the click event again.
Here is the code,

<img src="testimg.jpg" id="sub_form">

disabled the click event of above image using the code

$('#sub_form').unbind('click');

How do i recover the click event? I tried with the bind event

  $('#sub_form').bind('click');

but it wont work.

Why I’m going for click event of image is ajax form submission. The code is,

$("#sub_form").click(function() {
var input_data = $('#testform').serialize();
    $.ajax({ 
//my code
});
});

how can i achieve this after unbind of image is performed.

  • 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-01T02:28:37+00:00Added an answer on June 1, 2026 at 2:28 am

    If you saved the handler, you can just invoke it again:

    var handler = function() {
        alert('click');
    };
    
    $('#sub_form').click(handler);
    
    // disabling:
    $('#sub_form').unbind('click', handler);
    
    // reenabling:
    $('#sub_form').click(handler);
    

    If you don’t know what handlers that are bound, you can find and save them before unbinding:

    // save the click handlers
    var events = $('#sub_form').data('events'),
        handlers = 'click' in events ? Array.prototype.slice.call(events.click) : [],
        handler = function() {
            $.each(handlers, function() {
                this.handler();
            });
        };
    
    // disable
    $('#sub_form').unbind('click');
    
    // reenable
    $('#sub_form').bind('click', handler);​
    

    http://jsfiddle.net/sPPnE/

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

Sidebar

Related Questions

I successfully disabled the right click event on the page that I am working
How do I stop a click event handler added with jQuery's live method from
How can I enable the double click event for a disabled checkbox?
Here is the code: #include <iostream> #include <time.h> using namespace std; #define ARR_LENGTH 1000000
I am creating a button dynamically in my code and attaching a click event
When i press $('.walk-previous-button') i want to disable the click event until the animation
i have disabled all the checkboxes except one. On click of that checkbox i
I need a div to be disabled (so that it no longer receives click)
$('#ms_cats_meta_eduyear, #ms_cats_meta_semester, #ms_cats_meta_subject').change(function () { $('#publish').removeClass('button-primary-disabled'); $('#save-post').removeClass('button-disabled'); $('input#publish').click( function () { var eduyear_val =
how can i disable live('click', function...) method and then after ajax call (depending on

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.