The 'disabled' attribute is for the form elements themselves, they
don't "cascade" down the parents. Also, in XHTML the disabled
attribute doesn't use a boolean value. This should disable all form
input elements:
$('table:input').attr('disabled','disabled');
(:input is a pseudo-selector for input,textarea and select)
- ricardo
On Oct 29, 12:35 pm, soni2926 <[EMAIL PROTECTED]> wrote:
> hi,
> i have a table which has elements in it, input, dropdown, and i want
> them disabled at certain times, can i do this is jquery? any examples?
> suppose table is like:
> <table cellpadding="0" cellspacing="5" border="0" id="testTable">
> <tr>
> <td class="Column">
> Phone:
> </td>
> <td class="Column">
> <input name=TextBox1" type="text" id="TextBox1" />
> </td>
> <td class="Column">
> Type:
> </td>
> <td class="Column">
> <select name="DropDownList1" id="DropDownList1">
> <option value="Op1">Op1</option>
> <option value="Op2">Op2</option>
> <option value="Op3">Op1</option>
> </select>
> </td>
> </tr>
> </table>
>
> And at certain conditions i want to display all of those elements,
> anyway to do that? i'm still learning jquery, but i know this disables
> the table:
> $('#testTable').attr("disabled", true);
> but the elements are still active. anyway to loop through each and
> stop them? i tried:
> $('#testTable > tr').attr("disabled", true);
> but that didn't work, plus i don't know if disabling the row would
> work, same with this:
> $('#testTable > input').attr("disabled", true);
>
> Thanks.