Note that there are some explanatory texts on larger screens.

plurals
  1. PODisable all other TDs in a row if first TD is selected
    primarykey
    data
    text
    <p>I have a table that contains multiple rows. Each row contains 5 columns (or 5 TDs). Inside of the first TD is a text field and a select box. The 4 other TDs each contain a table that contains a set of radio buttons.</p> <pre><code>&lt;tr bgcolor=#ffffff&gt; &lt;td valign=center&gt; &lt;select name=player1&gt; &lt;option&gt;0&lt;/option&gt; &lt;option&gt;1&lt;/option&gt; &lt;/select&gt; &lt;input type="text" id="PlayerLocal1" name=p1name size=20&gt; &lt;/td&gt; &lt;td&gt; &lt;table border=1&gt; &lt;tr&gt; &lt;td&gt; &lt;table border=0 cellspacing=0 cellpadding=0&gt; &lt;tr&gt; &lt;td&gt;&lt;input type=radio name=p1o1 value="1B"&gt;1B &lt;td&gt;&lt;input type=radio name=p1o1 value="FO"&gt;FO &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;/td&gt;&lt;/tr&gt; </code></pre> <p>Basically I want the radio buttons in each of the 4 other TDs disabled unless the user inputs a value in the text field OR selects a value in the select field.</p> <p>I was thinking of adding a class to each TR, then somehow traversing each TD that isn't the first TD and removing the disabled attribute (to enable it), but I can't wrap my head around how create the conditional statement or whether I need to use Parents() or Siblings() or something else to traverse. </p> <p><strong>Quick Clarification:</strong> My table has multiple rows and multiple columns (I only showed 2 of the TDs to save space, but the other 3 TDs looks just like the 2nd). For instance, player1 and p1name1 will be player2 and p2name2 in the second row. So, if the text/select is changed in the FIRST row, it shouldn't enable all radio buttons in ALL rows -- only radio buttons the FIRST row. </p> <p>Any help is appreciated!</p>
    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.
 

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