disable all objects defined in a column

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rithish Saralaya

    #1

    disable all objects defined in a column

    I have a column in a table as follows,

    <TD ID='COL_ID_1'> Test Text <IMG ID='IMG_ID_1'
    SRC='http://myServer.com/images/myImg.gif' onClick=\"alert ( 'clicked'
    )\"></TD>
    I want to disable the whole column, alongwith all its data defined
    within it.

    I tried using document.all ( 'COL_ID_1' ).disabled = true; However,
    this disables only the text within the column. I have to loop through
    the children of the TD to disable all objects defined within.

    child = document.all ( 'COL_ID_1' ).children;
    tot_children = child.length;
    for ( i=0; i<=tot_childre n-1; i++ )
    {
    document.all ( child(i).id ).disabled = true;
    }


    Is this the proper way, or am I doing wrong? Why does not the first
    approach work for all child objects of the TD?
    The target browser is IE5+. Any help/advice/suggestions would be
    greatly appreciated.

    Regards,
    Rithish.
  • Alberto

    #2
    Re: disable all objects defined in a column

    Loop the child nodes as you do, that's the most sensible way to do that for
    me.

    ciao
    Alberto

    "Rithish Saralaya" <rithish@gmail. com> ha scritto nel messaggio
    news:68a92be4.0 408170546.137ac de0@posting.goo gle.com...[color=blue]
    > I have a column in a table as follows,
    >
    > <TD ID='COL_ID_1'> Test Text <IMG ID='IMG_ID_1'
    > SRC='http://myServer.com/images/myImg.gif' onClick=\"alert ( 'clicked'
    > )\"></TD>
    > I want to disable the whole column, alongwith all its data defined
    > within it.
    >
    > I tried using document.all ( 'COL_ID_1' ).disabled = true; However,
    > this disables only the text within the column. I have to loop through
    > the children of the TD to disable all objects defined within.
    >
    > child = document.all ( 'COL_ID_1' ).children;
    > tot_children = child.length;
    > for ( i=0; i<=tot_childre n-1; i++ )
    > {
    > document.all ( child(i).id ).disabled = true;
    > }
    >
    >
    > Is this the proper way, or am I doing wrong? Why does not the first
    > approach work for all child objects of the TD?
    > The target browser is IE5+. Any help/advice/suggestions would be
    > greatly appreciated.
    >
    > Regards,
    > Rithish.[/color]


    Comment

    Working...