Checkbox not available in ASP.NET page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lightgram
    New Member
    • Sep 2007
    • 9

    Checkbox not available in ASP.NET page

    Hi

    I need to reset the position of a checkbox in my ASP.NET page.

    The checkbox is defined:

    [CODE=asp]<asp:CheckBox TextAlign=left ID="CheckBox2" Style="z-index: 203; left: 538px; position: absolute; top: 144px;" Text="Test CKBOX"
    runat="server" />[/CODE]

    In the script when the page loads I have the following code that recalculates the left position:

    [CODE=javascript]document.getEle mentById("Check Box2").style.le ft = parseInt(docume nt.getElementBy Id("CheckBox2") .style.left) + document.getEle mentById("dvSpa cer").style.pos Width; [/CODE]

    However this produces an 'Invalid argument' error. The same line of code works for my other controls on this page but not this one. Does anyone please have any idea what I am doing wrong.

    Thanks in advance.
    Last edited by gits; Sep 24 '07, 09:43 AM. Reason: added code tags
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Lightgram. Welcome to TSDN!

    Please use CODE tags when posting source code:

    &#91;CODE=javas cript]
    JavaScript code goes here.
    &#91;/CODE]

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      posWidth is non-standard. Use width instead. Can you give some example values.

      Comment

      Working...