Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make a readonly input field editable on the bases of dropdown option's value
    text
    copied!<p>I am working on a ONLINE Order System using visual studio as framework and asp classic and vb.net as languages combined with html and javascript. I want to make input fields of a HTML form readonly and editable on the bases of selected value of a drop down list.My code is</p> <pre><code>&lt;table border="0" width="61.2%" align=center&gt;&lt;tr &gt;&lt;td colspan=2 id="bg_page_title" align="center" valign="middle"&gt;&lt;strong&gt; Product Edit Wizard &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td align="right" width="50%"&gt;&lt;b&gt;Product Name:&lt;/b&gt;&lt;/td&gt; &lt;tr&gt; &lt;td align="right" width="50%"&gt;&lt;b&gt;What You Want To Do:&lt;/b&gt;&lt;/td&gt; &lt;td width="50%"&gt; &lt;select name="what_change" id="ma" onChange="changetextbox()" &gt; &lt;option value="0"&gt; Select Option&lt;/option&gt; &lt;option value="1" &gt; Bonus Changed&lt;/option&gt; &lt;option value="2" &gt; Price Changed&lt;/option&gt; &lt;option value="3" &gt; Product Discontinue&lt;/option&gt; &lt;option value="4" &gt; Product Re-Open&lt;/option&gt; &lt;/select&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr id=Tr1&gt; &lt;td align="right" width="50%" &gt;&lt;b&gt;Ex-Fact Price:&lt;/b&gt;&lt;/td&gt; &lt;td width="50%"&gt; &lt;tr id=Tr1&gt; &lt;td align="right" width="50%" &gt;&lt;b&gt;Ex-Fact Price:&lt;/b&gt;&lt;/td&gt; &lt;td width="50%"&gt; &lt;input type="text" id="ma" name="f_price" value="&lt;%=rs("f_price")%&gt;" &gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr id=Tr2&gt; &lt;td align="right" width="50%" &gt;&lt;b&gt;Ex-Dist Price:&lt;/b&gt;&lt;/td&gt; &lt;td width="50%" &gt;&lt;input type="text" id="ma" name="d_price" value="&lt;%=rs("d_price")%&gt;" &gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr id=Tr3&gt; &lt;td align="right" width="50%" &gt;&lt;b&gt;Bonus Flat Rate:&lt;/b&gt;&lt;/td&gt; &lt;td width="50%" &gt;&lt;input type="text" id="ma" name="bonus_rate" value=" &lt;%=rs("bonus_rate")%&gt;" &lt;/td&gt; &lt;/tr&gt; &lt;tr id=Tr4&gt; &lt;td align="right" width="50%" &gt;&lt;b&gt;Bonus Scheme:&lt;/b&gt;&lt;/td&gt; &lt;td width="50%" &gt;&lt;input type="text" id="ma" name="bonus_sch" value=" &lt;%=rs("bonus_sch")%&gt;" &gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr id=Tr5&gt; &lt;td align="right" width="50%" &gt;&lt;b&gt;Bonus Units:&lt;/b&gt;&lt;/td&gt; &lt;td width="50%" &gt;&lt;input type="text" id="ma" name="bonus_units" value="&lt;%=rs("bonus_units")%&gt;" &gt; &lt;/td&gt;&lt;/tr&gt; </code></pre> <p>I want to do that when user select 'bonus change" only relevant fields of bonus will editable and others will remain readonly. and when user select "price change" only relevant fields of price will be editable and other will change to readonly. Kindly guide me to solve my problem. Thanx </p>
 

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