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

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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?
    Simon Brown Guest

  2. Similar Questions and Discussions

    1. All website connections are disabled. At least oneconnection must be enabled to choose a file or folder on awebsite
      Hi There, I have a website running on : Windows 2003, IIS 6.0, ColdFusion MX 7 and Contribute 3.0 with Contribute Publishing Services 1.1 ...
    2. Detect if Javascript & Cookies Enabled
      Hi, DWMX using VBSCRIPT + some simple javascript (and DWMX form validation which uses javascript) I also use session variables, which I believe...
    3. Enabled / Disabled my control
      Hi, My Control (inherits from System.Web.UI.Control) has the Enabled property that enabled a button inside of my control. The problem is that in...
    4. Given that some browsers dont have javascript enabled....
      Given that some browsers dont have javascript enabled.... do developers try to avoid using javascript when a php alternative can be used? What sort...
    5. Problem using .NET UniqueID to reference RadioButton in Javascript?
      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...
  3. #2

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

    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" <flowinlife@hotmail.com> wrote in message
    news:dc1895a6.0308080009.15f4221b@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?

    DWinter Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139