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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:00:24+00:00 2026-05-11T02:00:24+00:00

Consider this sample code: <div class=containter id=ControlGroupDiv> <input onbeforeupdate=alert(‘bingo 0’); return false; onclick=alert(‘click 0’);return

  • 0

Consider this sample code:

<div class='containter' id='ControlGroupDiv'>   <input onbeforeupdate='alert('bingo 0'); return false;' onclick='alert('click 0');return false;' id='Radio1' type='radio' value='0' name='test' checked='checked' />     <input onbeforeupdate='alert('bingo 1'); return false;' onclick='alert('click 1');return false;'  id='Radio2' type='radio' value='1' name='test' />      <input onbeforeupdate='alert('bingo 2'); return false;' onclick='alert('click 2');return false;'  id='Radio3' type='radio' value='2' name='test' />      <input onbeforeupdate='alert('bingo 3'); return false;' onclick='alert('click 3');return false;'  id='Radio4' type='radio' value='3' name='test' />      <input onbeforeupdate='alert('bingo 4'); return false;' onclick='alert('click 4');return false;'  id='Radio5' type='radio' value='4' name='test' />      <input onbeforeupdate='alert('bingo 5'); return false;' onclick='alert('click 5');return false;'  id='Radio6' type='radio' value='5' name='test' />    </div> 

On FireFox 2 and 3, putting the return false on the click event of a radio button prevents the value of it and of all the other radio buttons in the group from changing. This effectively makes it read-only without disabling it and turning it gray.

On Internet Explorer, if another radio button is checked and you click on a different one in the group, the checked one clears before the click event fires on the one you clicked. However, the one you clicked on does not get selected because of the ‘return false’ on the click event.

According to MSDN, the onbeforeupdate event fires on all controls in the control group before the click event fires and I assumed that was where the other radio button was being cleared. But if you try the code above, no alert is ever shown from the onbeforeupdate event – you just get the click event alert. Evidently that event is never getting fired or there isn’t a way to trap it.

Is there any event you can trap that allows you to prevent other radio buttons in the group from clearing?

Note that this is a simplified example, we are actually using jQuery to set event handlers and handle this.

Update:

If you add this event to one of the radio buttons:

onmousedown='alert('omd'); return false;' 

The alert box pops up, you close it, and the click event never fires. So we thought we had it figured out, but no, it couldn’t be that easy. If you remove the alert and change it to this:

onmousedown='return false;' 

It doesn’t work. The other radio button clears and the click event on the button you clicked on fires. onbeforeupdate still never fires.

We thought it might be timing (that’s always a theory even though it’s rarely true), so I tried this:

onmousedown='for (i=0; i<100000; i++) {;}; return false;' 

You click, it pauses for a while, then the other radio button clears and then the click event fires. Aaargh!

Update:

Internet Explorer sucks. Unless someone comes up with a good idea, we’re abandoning this approach and going with the checkbox jQuery extension which does do what we want, but puts a heavier client-side script burden on the page and requires more recoding of the HTML because of the ASP.Net server control rendering and master-page name mangling.

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

    None of these approaches worked – we wound up using the checkbox jQuery plug-in that replaces the checkboxes and radio buttons with shiftable images. That means that we can control the view of the disabled controls.

    PITA but it works.

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

Sidebar

Ask A Question

Stats

  • Questions 160k
  • Answers 160k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Will clients have to upgrade their .NET Framework CLR (like… May 12, 2026 at 11:34 am
  • Editorial Team
    Editorial Team added an answer There is no built-in way to get a callers binding… May 12, 2026 at 11:34 am
  • Editorial Team
    Editorial Team added an answer Well, you can do it with 3 divs. <div class="bg"><div… May 12, 2026 at 11:34 am

Related Questions

Consider this sample code: <div class=containter id=ControlGroupDiv> <input onbeforeupdate=alert('bingo 0'); return false; onclick=alert('click 0');return
Here's a very simple Prototype example. All it does is, on window load, an
Consider i have a window Application,developed in Visual Studio 2005, having a button. I
What's the best way to call a generic method when the type parameter isn't
Imagine a generic class MySet which maintains a parent MySet instance and a child

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.