SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript disable checkbox not working after codebehind disable

    I have a simple javascipt which enables/disables some checkboxes when another checkbox ticked/unticked. This works fine, however, in some instances when by page is loaded my code behind disables the same check boxes. When this happenes my original check box nolonger seems to have any influence in enableing or disabling - there is no error and all the elements seem to be found by the javascript - it just doesn't enable/disable the checkboxes.

    Does the code behind disable method do something a bit more perminant to disable the check boxes?


    cheers

    monkey
    monkey - the rest is history

  2. #2
    SitePoint Member
    Join Date
    Aug 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    please take some reference from simply JavaScript book that is published by sitepoint.

  3. #3
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Robert William View Post
    please take some reference from simply JavaScript book that is published by sitepoint.
    eh? Its a .net issue!
    monkey - the rest is history

  4. #4
    SitePoint Addict
    Join Date
    Feb 2005
    Location
    Clogland
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you looked at the HTML source code?

  5. #5
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Simple answer - .net disables a form object completely!
    monkey - the rest is history

  6. #6
    SitePoint Addict
    Join Date
    Feb 2005
    Location
    Clogland
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No it doesn't, look at the source code, here is an example:

    ASP.Net Source:

    Code:
    <asp:CheckBox ID="CheckBox1" runat="server" />
    <asp:CheckBox ID="CheckBox2" runat="server" Enabled="false" />
    Generated HTML:
    Code HTML4Strict:
    <input id="CheckBox1" type="checkbox" name="CheckBox1" />
    <span disabled="disabled"><input id="CheckBox2" type="checkbox" name="CheckBox2" disabled="disabled" /></span>


Bookmarks

Posting Permissions

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