473,387 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

javascript disabled radiobutton doesn't get enabled in asp.net

Hi,

here's the code, i have removed the irrelevent stuff

<HEAD>
<title>WebForm1</title>
<script language="javascript">
function DisableRadio()
{
document.Form1.RadioButton1.disabled = true;
}
</script>
</HEAD>
<body onload="DisableRadio()">
<asp:RadioButton id="RadioButton1" runat="server" Width="48px"
Height="42px"></asp:RadioButton>
</body>

I disable the button using DisableRadio() javascript function...
then i try to enable it using the following asp.net code

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
CheckBox1.Enabled = True
End Sub
it doesn't get enabled... why? Does the body_onload is called after
Page_Load??
what am i doing wrong?
Nov 17 '05 #1
1 1896
Yes, your assumption is correct. The Private Sub Page_Load is called first
to create the html to stream to the client, then the browser runs the html,
which runs the body onload event.

"Simon Brown" <fl********@hotmail.com> wrote in message
news:dc**************************@posting.google.c om...
Hi,

here's the code, i have removed the irrelevent stuff

<HEAD>
<title>WebForm1</title>
<script language="javascript">
function DisableRadio()
{
document.Form1.RadioButton1.disabled = true;
}
</script>
</HEAD>
<body onload="DisableRadio()">
<asp:RadioButton id="RadioButton1" runat="server" Width="48px"
Height="42px"></asp:RadioButton>
</body>

I disable the button using DisableRadio() javascript function...
then i try to enable it using the following asp.net code

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
CheckBox1.Enabled = True
End Sub
it doesn't get enabled... why? Does the body_onload is called after
Page_Load??
what am i doing wrong?

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
1
by: David Whitney | last post by:
Hi, all. I'm trying to work with some client-side scripting issues with an ASP.NET application. I realize I've probably done something wrong, but at the moment it looks to me like an...
1
by: Mateo | last post by:
Hi, is there a way to display a disabled radiobutton as enabled? (without enabling it of course). In other words, how can I lock a radiobutton without dimming it? My problem is that when the...
1
by: novice_developer | last post by:
Hi All, there is a radiobuttonlist having 2 list items (state & zipcode). when i select state radiobutton the zipcode textbox should be disabled and when i select a zipcode radiobutton the state...
10
by: David Thielen | last post by:
Hi; When a user clicks a radio button, what I would like to do is that if javascript is enabled on their browser, it calls a javascript function and does not do a postback. If javascript is...
2
by: rodchar | last post by:
hey all, is there a neater way to write the following javascript code? Basically there just 3 controls on my webform a button,checkbox,radio button. if you check the checkbox it just enables the...
8
by: Taras_96 | last post by:
Hi everyone, We' ve come to the conclusion that we wish the user to be directed to an error page if javascript is disabled <enter comment about how a webpage shouldn't rely on javascript here :)...
15
by: Prisoner at War | last post by:
Okay, I think I'll soon be getting all the JavaScript/CSS/DHTML- related "site mechanics" wrapped up...at least until I decide on real Ajax-style interactivity next year! But until then, I'd be...
2
by: Pselus | last post by:
I have a form that is built pretty much entirely at run time. I load a collection of Categories which have multiple Plans. Each Plan has a RadioButton. Each Category has a single PriceTag...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.