Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Java Script modification :</strong></p> <pre><code>function toggleTB(what){ var theTB = document.getElementById(what.value); if(what.checked){theTB.disabled=1} else{theTB.disabled=0} </code></pre> <p>}</p> <p><strong>HTML Modification :</strong></p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td style="border-top:none; text-decoration:underline;" &gt;Specific operations/procedures&lt;/td&gt; &lt;td&gt; &lt;input type="checkbox" name="sd3[]" onClick="toggleTB(this)" value="mfi_nam9" /&gt;Other(please specify): &lt;input type="text" name="mfi_nam9" id="mfi_nam9" class="text required" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="border-top:none; text-decoration:underline;" &gt;General principles/strategies&lt;/td&gt; &lt;td&gt; &lt;input type="checkbox" name="sd2[]" onClick="toggleTB(this)" value="mfi_nam8" /&gt;Other(please specify): &lt;input type="text" name="mfi_nam8" id="mfi_nam8" class="text required" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p><strong>Note:</strong> Here I have used ID rather than NAME to verify the form <strong>input box</strong> element.</p> <p>I think this doesn't make sense to disable the <strong>TEXT BOX</strong> on <strong>checked</strong> event of the related <strong>CHECK BOX</strong>. You maybe want to enable the <strong>TEXT BOX</strong> whenever some one checked the check box to specify some other thing, I am not sure what you want to do with this.</p> <p>If you want to do like what I guess, just change the JAVA SCRIPT lines as bellow - </p> <pre><code>if(what.checked){theTB.disabled=0} // have placed 0 in place of 1 else{theTB.disabled=1} // have placed 1 in place of 0 } </code></pre> <p><strong>HTML INPUT-BOX as bellow -</strong> </p> <p></p> <p>OR if you think to toggle (enable/disable) the <strong>checkbox</strong>, this is not possible cause you know after disable an element the click event will not do action on the element so how it will be disable :)</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.
    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