cells Hide/show in each of the rows of a table using javascript

Discussion in 'JavaScript' started by amarjit111, Aug 15, 2010.

  1. #1
    Hi friends,

    I have a table which is given below. If I select 'No' from the 'heading1' row, I want to hide 'Heading2', 'heading3' and 'heading4' in the same row. otherwise I select 'Yes' i want to show all the option in 'Heading2', 'heading3' and 'heading4'. Also in between if we select 'No' from the 'heading3' I want to hide 'heading4' alternatively if we select 'Yes' in 'heading3', i want to show 'heading4'.

    I want to put this hide/show in each and every rows of this table.

    I have tried many times but not able to write this code.
    Can anyone in the forum help me in writing this code using javascript?


    TABLE
    ----------------------------------------------------------------------------|
    | Heading1 | Heading2 | Heading3 | Heading4 |
    |------------------|-------------------|------------------|------------------|
    | (.) Yes | Input box | (.) Yes | Input box |
    | (.) No | | (.) No | |
    ----------------------------------------------------------------------------|
    | (.) Yes | Input box | (.) Yes | Input box |
    | (.) No | | (.) No | |
    ----------------------------------------------------------------------------|
    | (.) Yes | Input box | (.) Yes | Input box |
    | (.) No | | (.) No | |
    ----------------------------------------------------------------------------|


    Amarjit
     
    amarjit111, Aug 15, 2010 IP