Note that there are some explanatory texts on larger screens.

plurals
  1. POenabled text box in the table with rowspan using jquery
    primarykey
    data
    text
    <p>I am stuck in a problem, i have the following html structure. Initially, all text box are disabled.<br> When i tick some checkbox in the first column, i want to enable the text box in this line. The problem is that i can enable all text boxs except "Tag 02". I believe that there is a "rowspan=2" in row2, so my code cannot find td in tag02 line. I post my code below, anybody could help me to figure out this problem? Thanks a lot.</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;table border="1" id="settbl" cellspacing="0" cellpadding="0" width="500"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;&lt;/th&gt; &lt;th colspan="2"&gt;Setting&lt;/th&gt; &lt;th&gt;Value&lt;/th&gt; &lt;th&gt;Units&lt;/th&gt; &lt;th&gt;&amp;nbsp;&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="checkbox"/&gt;&lt;/td&gt; &lt;td colspan="2"&gt;Row1&lt;/td&gt; &lt;td&gt;&lt;input type="text"/&gt;&lt;/td&gt; &lt;td&gt;Units&lt;/td&gt; &lt;td rowspan="10"&gt;&lt;button&gt;Edit&lt;/button&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td rowspan="2"&gt;&lt;input type="checkbox"/&gt;&lt;/td&gt; &lt;td rowspan="2"&gt;Row2&lt;/td&gt; &lt;td&gt;Tag 01&lt;/td&gt; &lt;td&gt;&lt;input type="text"/&gt;&lt;/td&gt; &lt;td&gt;Units&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Tag 02&lt;/td&gt; &lt;td&gt;&lt;input type="text"/&gt;&lt;/td&gt; &lt;td&gt;Units&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="checkbox"/&gt;&lt;/td&gt; &lt;td colspan="2"&gt;Row3&lt;/td&gt; &lt;td&gt;&lt;input type="text"/&gt;&lt;/td&gt; &lt;td&gt;Units&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>my Code here:</p> <pre><code>function enableRows(){ $('#settbl tr').filter(':has(:checkbox:checked)').each(function() { $(this).find('input[type=text],select').each(function() { this.disabled = false;//only enable "Row1","Row2-&gt;Tag01" and "Row3". }); }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload