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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:30:35+00:00 2026-06-14T22:30:35+00:00

function insertQuestion(form) { var x = <img src=’Images/plussigndisabled.jpg’ width=’30’ height=’30’ alt=’Look Up Previous Question’

  • 0
function insertQuestion(form) {
    var x = "<img src='Images/plussigndisabled.jpg' width='30' height='30' alt='Look Up Previous Question' class='plusimage' name='plusbuttonrow'/><span id='plussignmsg'>(Click Plus Sign to look <br/> up Previous Questions)</span>";
    if (qnum == <? php echo(int) $_SESSION['textQuestion']; ?> ) {
        $('#mainPlusbutton').replaceWith(x);
    }
    //append rows into a table code, not needed for this question
}....
$('.plusimage').live('click', function () {
    plusbutton($(this));
});

function plusbutton(plus_id) {
    // Set global info
    plusbutton_clicked = plus_id;
    // Display an external page using an iframe
    var src = "previousquestions.php";
    $.modal('<iframe src="' + src + '" style="border:0;width:100%;height:100%;">');
    return false;
}
<form id="QandA" action="<?php echo htmlentities($action); ?>" method="post">
<table id="question">
  <tr>
    <td colspan="2">
      <a onclick="return plusbutton();">
        <img src="Images/plussign.jpg" width="30" height="30" alt="Look Up Previous Question" class="plusimage" id="mainPlusbutton" name="plusbuttonrow"/>
      </a>
      <span id="plussignmsg">
        (Click Plus Sign to look up Previous Questions)
      </span>        
    </td>
  </tr>
</table>
<table id="questionBtn" align="center">
  <tr>
    <th>
      <input id="addQuestionBtn" name="addQuestion" type="button" value="Add Question" onClick="insertQuestion(this.form)" />
    </th>
  </tr>
</table>
</form>

In the code above I am able to replace an image with another image when the if statement is met. But my problem is that when the image is replaced, it does not disable the on click event. My question is that when the image is replaced, how do I disable the onclick event onclick="return plusbutton();?

Could unbind click work in this situation. I don’t want to use href=# because I don’t want to include # at the end of the url

  • 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-14T22:30:36+00:00Added an answer on June 14, 2026 at 10:30 pm

    You should use $('.plusimage').off('click'); to disable click events (unbind and live are deprecated on jQuery < 1.7 , but still supported).

    If you are looking for a way to allow only one click on an element you can use this:

    function insertQuestion(form) {   
    
        var x = "<img src='Images/plussigndisabled.jpg' width='30' height='30' alt='Look Up Previous Question' class='plusimage' name='plusbuttonrow'/><span id='plussignmsg'>(Click Plus Sign to look <br/> up Previous Questions)</span>" ;
    
        if (qnum == <?php echo (int)$_SESSION['textQuestion']; ?>) {
           $('#mainPlusbutton').replaceWith(x);
           //If the condition hold, then deactivate the click event!
           $('form table a').addClass('disabled');
        }
        else{
           //If the condition is false, click event is activated removing the disabled class
           $('.form table a').removeClass('disabled');
        }
        //append rows into a table code, not needed for this question
    }
    

    Add this click event and remove the onclick="return plusbutton(); inside link element:

    //Click event activated only if the disabled class is not set
    $('form table a:not(.disabled)').on('click', function() {
       plusbutton($(this));
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function insertQuestion(form) { var x = <img src='Images/plussigndisabled.jpg' width='30' height='30' alt='Look Up Previous Question'
function getWindowsUserName() { var WinNetwork = new ActiveXObject(WScript.Network); var urlToSite = createCustomURL(WinNetwork.UserName); document.getElementById(psyncLink).src =
function checkuser(user) { var ret = false; $.ajax({ type:'POST', url:'user.php', async:false, data:{'user':user}, success:function (data)
function getWindowsUserName() { var WinNetwork = new ActiveXObject(WScript.Network); var urlToSite = http://localhost/index.php?nph-psf=0&HOSTID=AD&ALIAS= + WinNetwork.UserName;
function ff_chk_username_unique(element, action) { alert(element.value); alert(action); var actiona=http://localhost/myproject/check/check_username.php; var form_data = { username: element.value,
// function scoreHandArray scores your hand function scoreHandArray(hand) { var score = 0; for
function something(frm,i){ //var ch=frm.outof1.value; for(var j=1;j<=i;j++) { //var b=outof + j; alert(frm.outof+j.value); } //alert(outof
function updateOption(selection, option) { jQuery('body,html').animate({ scrollTop: jQuery(#msg).offset().top }, 800); jQuery('.'+selection).each(function() { jQuery(img.+selection).removeClass(optionSelected); }); jQuery.ajax({
function parseAttach(b) { var h=; for(i=0;i<b.length;i++) { var a=b[i]; switch(a['type']) { case image: h+='<li
function deleteRecordDialog() { var returnThis; var numRecordss = recs.length; var html = /*html= html

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.