Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <title>MINO</title>
  5.         <meta charset="UTF-8">
  6.     </head>
  7.     <body>
  8.         <h3><strong>ФОРМА ЗА ВНЕСУВАЊЕ ОЦЕНКИ</strong></h3>
  9.        
  10.         <table id="tabela1">
  11.            
  12.             <tr>
  13.                 <td>Ime:</td>
  14.                 <td><input type="text" id="ime"></td>
  15.             </tr>
  16.             <tr>
  17.                 <td>Prezime:</td>
  18.                 <td><input type="text" id="prezime"></td>
  19.             </tr>
  20.             <tr>
  21.                 <td>Indeks:</td>
  22.                 <td><input type="text" id="indeks"></td>
  23.             </tr>
  24.             <tr>
  25.                 <td>Predmet:</td>
  26.                 <td><input type="text" id="predmet"></td>
  27.             </tr>
  28.             <tr>
  29.                 <td>Ocenka:</td>
  30.                 <td>
  31.                     <select id="opcija">
  32.                         <option value="5 (pet)">5 (pet)</option>
  33.                         <option value="6 (sest)">6 (sest)</option>
  34.                         <option value="7 (sedum)">7 (sedum)</option>
  35.                         <option value="8 (osum)">8 (osum)</option>
  36.                         <option value="9 (devet)">9 (devet)</option>
  37.                         <option value="10 (deset)">10 (deset)</option>
  38.                     </select>
  39.                 </td>
  40.             </tr>
  41.             <tr>
  42.                 <td>
  43.             <button type="button" id="vnesi" onclick="klik()">Vnesi</button>
  44.             </td>
  45.             </tr>
  46.     </table>
  47.    
  48.     <table id="tabela2" border="1">
  49.         <tr>
  50.             <td><strong>Ime</strong></td>
  51.             <td><strong>Prezime</strong></td>
  52.             <td><strong>Indeks</strong></td>
  53.             <td><strong>Predmet</strong></td>
  54.             <td><strong>Ocena</strong></td>
  55.         </tr>
  56.     </table>
  57. </body>
  58.  
  59. <script type="text/javascript">
  60.  
  61.     document.getElementById("tabela2").style.visibility="hidden";
  62.     var br=1;
  63.    
  64.     function klik(){
  65.         var x,y,z,t,pom1,pom2;
  66.        
  67.         x = document.getElementById("ime").value;
  68.         y = document.getElementById("prezime").value;
  69.         z = document.getElementById("indeks").value;
  70.         t = document.getElementById("predmet").value;
  71.        
  72.         pom1 = document.getElementById("opcija");
  73.         pom2 = pom1.options[pom1.selectedIndex].value;
  74.         tabela3 = document.getElementById("tabela2");
  75.         tabela3.style.visibility="visible";
  76.        
  77.         var redica = tabela3.insertRow(br++);
  78.         var kolona1 = redica.insertCell(0);
  79.         var kolona2 = redica.insertCell(1);
  80.         var kolona3 = redica.insertCell(2);
  81.         var kolona4 = redica.insertCell(3);
  82.         var kolona5 = redica.insertCell(4);
  83.        
  84.         kolona1.innerHTML = x;
  85.         kolona2.innerHTML = y;
  86.         kolona3.innerHTML = z;
  87.         kolona4.innerHTML = t;
  88.         kolona5.innerHTML = pom2;
  89.        
  90.        
  91.         document.getElementById("ime").value = null;
  92.         document.getElementById("prezime").value = null;
  93.         document.getElementById("indeks").value = null;
  94.         document.getElementById("predmet").value = null;
  95.         document.getElementById("opcija").selectedIndex = "0";
  96.        
  97.     }
  98.    
  99.     </script>
  100.    
  101.    
  102. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement