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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T17:04:05+00:00 2026-05-14T17:04:05+00:00

I have an onclick event attached to a button. Clicking the button adds a

  • 0

I have an onclick event attached to a button.
Clicking the button adds a text box to the target div.

The code is:

onclick="return addBlank("param1","param2");

The function addBlank does not have a return statement.

Clicking on the button behaves as intended in Firefox, Opera, Chrome and Safari – i.e., an empty text box is added to the target div and page is not reloaded.

Clicking on the button in IE8 forces a page reload and doesn’t add anything to the target div.

Is there an onclick incompatibility that I’m missing here?

I appreciate your taking the time to read this doubt!

  • 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-14T17:04:06+00:00Added an answer on May 14, 2026 at 5:04 pm

    Why not add

    return false;
    

    to the end of the function then? It should prevent anything happening as a result of the onclick event.

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

Sidebar

Related Questions

I have a form on ASP .NET page, with button onclick event attached to
I have a little javascript function which is attached to an onClick event of
If you have a JSF <h:commandLink> (which uses the onclick event of an <a>
I have this solution for a single button: myButton.Attributes.Add(onclick, this.disabled=true; + GetPostBackEventReference(myButton).ToString()); Which works
I have Buttons attached to elements on the modules entrypoint html page using RootPanel.get(foo).add(button)
I have an gridview that I am adding onclick events to a checkbox column
rbnResubmission.Items.FindByValue(Yes).Attributes.Add(onclick, getCheckedRadioFieldResubmission(this)); rbnResubmission.Items.FindByValue(No).Attributes.Add(onclick, getCheckedRadioFieldResubmission(this)); So I have these click events for showing rows in
I have an onclick handler for an <a> element (actually, it's a jQuery-created handler,
I have an element with an onclick method. I would like to activate that
I have two elements: <input a> <input b onclick=...> When b is clicked, I

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.