views:

24

answers:

1

How can I hide or show the value contained inside a TD tag?

E.g:

<td id="dateCell<%= i %>">
<%= Html.Encode(row.ActionOn.HasValue ? Html.FormatDateTime(row.ActionOn.Value) : Html.Encode("")) %>
</td>

How can I get the encoded value and hide or show it depending on a condition?

A: 
$('#myDropDown').change(function() {
if($(this).val() == 4) {
    $('#dateCell').hide();
} else if($(this).val() == 3) {
    $('#dateCell').show();
}

});

although this will hide the entire td, which isn't necessarily a good practice

Michael
I achieved it by creating a span around the cell value and giving it an unique id. By doing so I could hide only the span instead of the whole td. Thanks anyway for your help.
Hallaghan