| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 
 |  
 
<HTML>
   <HEAD>
      <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
      <TITLE>xxxxxxxx</TITLE>
      <style type="text/css">
             .my_css {
             width:1px;
             }
      </style>
      <script>
        window.onload = function() {
            document.getElementById('document1').style.display = 'none';
        }
 
        function addElements() {
 
            var number = document.getElementById("x").value;
 
            var document1= document.getElementById("document1");
 
            while (document1.hasChildNodes()) {
 
                document1.removeChild(document1.lastChild);
            }
 
 
            for (j = 0; j < number; j++) {
                var newRow1 = document.createElement('tr');
 
                newRow1.innerHTML = '<td> <input type="text" name="Designation_' + j + '" ></td>';
 
                document1.appendChild(newRow1);
            }
 
 
 
            if (number == 0) {
 
                document.getElementById('document1').style.display = 'none';
            } else {
 
                document.getElementById('document1').style.display = 'block';
            }
        }
 
      </script>
 
   </HEAD>
 
   <form >
 
      <table>
 
         <tr>
            <td>
               <select id='x' name='x' onChange='addElements()'>
                  <option value='0'>0</OPTION>
                  <OPTION value='1'>1</OPTION>
                  <OPTION value='2'>2</OPTION>
                  <OPTION value='3'>3</OPTION>
                  <OPTION value='4'>4</OPTION>
               </select>
            </td>
            <br>
         </tr>
         <tr>
             <td><div id ="document1"></div> </td>
             <td><div id ="document2"></div> </td>
             <td> </td>
             <td> </td>
         </tr>
      </table>
   </form>
   </body>
</html> | 
Partager