Wrox Home  
Search P2P Archive for: Go

  Return to Index  

html_code_clinic thread: dynamic enabling of fields


Message #1 by "J.Priyadharshini" <puppy1978@r...> on Sat, 7 Apr 2001 11:45:32
Hi all at p2p,

  Please tell me what can be done to solve the problem 
described below. 

// Please run this html code 


<table>

Number of future plans for prevention :     

Not known<input type="radio" name="radiobutton" value="0" >
                      
One<input type="radio" name="radiobutton" value="1">
                     
 Two<input type="radio" name="radiobutton" value="2">
                   
 Three<input type="radio" name="radiobutton" value="3">
                 
          
            <td width="44%" height="18"> 
             Future plans for prevention :
            </td>
            <td width="12%" height="18"> 
              Email-Id
            </td>
            <td width="15%" height="18"> 
                 Owner /  Action by 
                </td>
            <td width="9%" height="18"> 
              Target Date
            </td>
            <td width="7%" height="18">Done</td>
            <td width="13%" height="18"> 
              Impl.  Date
            </td>
          
          <tr> 
            <td width="44%">
	One :
              <textarea name="future" cols="30" rows="4"></textarea>
            </td>
            <td width="12%"> 
              <input type="text" name="uid" size="14">
            </td>
            <td width="15%"> 
              <input type="text" name="uowner" size="16">
            </td>
            <td width="9%">
              <input type="text" name="utarget" size="8">
              </td>
            <td width="7%">  
              <input type="checkbox" name="checku" value="true">
            </td>
            <td width="13%"> 
              <input type="text" name="ucomplete" size="8">
            </td>
          
          <tr>
            <td width="44%">
Two :
              <textarea name="future2" cols="30" rows="4"></textarea>
            </td>
            <td width="12%"> 
              <input type="text" name="uid2" size="14">
            </td>
            <td width="15%"> 
              <input type="text" name="uowner2" size="16">
            </td>
            <td width="9%">
              <input type="text" name="utarget2" size="8">
              </td>
            <td width="7%">   
              <input type="checkbox" name="checku2" value="true">
            </td>
            <td width="13%"> 
              <input type="text" name="ucomplete2" size="8">
            </td>
          </tr>
          <tr> 
            <td width="44%">
Three  :
              <textarea name="future3" cols="30" rows="4"></textarea>
            </td>
            <td width="12%"> 
              <input type="text" name="uid3" size="14">
            </td>
            <td width="15%"> 
              <input type="text" name="uowner3" size="16">
            </td>
            <td width="9%"> 
              <input type="text" name="utarget3" size="8">
              </td>
            <td width="7%">   
              <input type="checkbox" name="checku3" value="true">
            </td>
            <td width="13%"> 
              <input type="text" name="ucomplete3" size="8">
            </td>
          </tr></table>

// end of html code

 All I want to do is,
 If I select the radiobutton notknown all the three rows in the table 
should be made readonly(ie one,two & three).
 If I select the radiobutton one then only the fields in the first row 
corresponding to the first future plan of prevention should be enabled
and the other two should be readonly.similarly if I select two then one & 
two
shouldbe enabled & three should be made readonly.if i select three then all
 the  three should be enabled.

please help me with the javascript code.
Thanks in advance.

--priya

  Return to Index