Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript" charset="utf-8">
  2.       function generujToolName() {
  3.          
  4.           $.getJSON('changeToolName.php', {id:$('#inspectionNumber').val()}, function(data) {
  5.                
  6.               var toAppend = "";
  7.               for(var i = 0; i < data.length; i++){
  8.                   toAppend += '<option value = \"' + data[i].id + '\">' + data[i].tool + '</option>';
  9.               }
  10.               $("#toolName").empty();
  11.               $("#toolName").html(toAppend);
  12.      
  13.           }, "json");
  14.      
  15.       }
  16.       function generujParameter() {
  17.      
  18.             $.getJSON('changeParameter.php', {ino:$('#inspectionNumber').val(), id:$('#toolName').val(), text:$('#toolName').text()}, function(data) {
  19.                    
  20.               var toAppend = "";
  21.               for(var i = 0; i < data.length; i++){
  22.                   toAppend += '<option value = \"' + data[i].id + '\">' + data[i].tool + '</option>';
  23.               }
  24.               $("#parameter").empty();
  25.               $("#parameter").html(toAppend);
  26.        
  27.             }, "json");        
  28.       }
  29.      
  30.       $(document).ready(function() {
  31.         $('#inspectionNumber').change(function() {
  32.             generujToolName();
  33.         });
  34.         $('#toolName').change(function() {
  35.           generujParameter();
  36.         });
  37.       });
  38.  
  39.         </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement