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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:46:58+00:00 2026-05-25T02:46:58+00:00

Does anyone have any idea why the following callback doesn’t execute the code within?

  • 0

Does anyone have any idea why the following callback doesn’t execute the code within? I have a window.onload script (the only one) in my main .html page which is called, for some reason, immediately after the fadeTo.

$("#newentryform").fadeTo("fast", .25, function () {
    var newentry = prompt("Please enter a new item:", "");
    if ((newentry != null) && (newentry != "")) {
        var verify = confirm("Press 'OK' to confirm you wish to create a new entry:" + "\n" + newentry);
        if (verify == true) {
            processnewentry(newentry, dropid);
        }
    }
});

The above function is called from an onclick event in the main .HTML page.

EDIT–code requested in comments

This is the HTML around the button and onclick in question. The call is to the makenewitem function
which is the function above.

<div id="entryinput">
<p>Item<input type="text" id="createitem" readonly /><button  id="createitembutton"onClick="showbuttons(this.id)">Select...</button><button id="createnewitembutton" onClick="makenewitem(this.id)">+ New</button><button id="itemReset" onClick="resetbuttons(this.id)">Reset</button>
<input type="text" id="createitemval" style="display:none" readonly/>
<input type="text" id="createitemindex" style="display:none" readonly/>
</p>
</div>

This is the processnewentry function:

function processnewentry (newentryvalue, dropid)
{

if (dropid=="createnewitembutton")
{
    dropid="createitem";
}

    else
{
          dropid="olditem";
}

var createnewItm=document.getElementById(dropid);
    createnewItm.value=newitemvalue;
var createnewitemval=document.getElementById(dropid+"val");
    createnewitemval.value="";
var createnewitemindex=document.getElementById(dropid+"index");
    createnewitemindex.value="1";


        $("#newitemform").fadeTo("fast", 1);

        var currentPage="newitembuttonpressed";
        toggleStatus(currentPage);  //disable inputs and buttons in form


    var hidebutton=document.getElementById(dropid+"button").style.display="none";
    var subdropid=dropid.substr(6);
    var hidenewbutton=document.getElementById("createnew"+subdropid+"button").style.display="none";
    var displaycreateinput=document.getElementById(dropid).style.display="inline";

}

  • 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-05-25T02:46:58+00:00Added an answer on May 25, 2026 at 2:46 am

    If your onclick is placed on a submit button or an a tag, that might have something to do with it.

    You should add return false to your button onclick calls, like this:

    <button [...] onClick="showbuttons(this.id); return false;" />
    

    This prevents the default button action (which is submit) to occur.

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

Sidebar

Related Questions

Does anyone have any idea why the following code would output no match? boost::regex
Does anyone have any idea why the following script does not reset the place
Does anyone have any idea what is wrong with this create statement for mysql?
Does anyone have any idea why I get different line widths on the canvas
Does anyone have any idea if there is anything planned in the html5 or
Does anyone have any idea why money_format() is showing � instead of pound sign
Does anyone have any idea how to solve this problem please? This is the
Does anyone have any idea why annotate does not work anymore in rails 3.1
Does anyone have any idea if it is possible to put additional variables into
Does anyone have any experience using Cucumber and the code coverage tool SimpleCov? I'd

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.