Guest User

Untitled

a guest
Apr 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2.     function update_count(field_type) // OnChange event of dropdown in form
  3.     {
  4.         var skill=field_type.options[field_type.selectedIndex].value; // Value of selected item
  5.         if (skill != '') { // Error check
  6.             var url = '../modules/WWCQE/skill.php'; // Module call to get data
  7.             $.ajax({            
  8.                 type: "POST",
  9.                 url: url,
  10.                 data: "skill_level="+skill, // Passed in variable
  11.                 dataType: "json", // Html, data or json
  12.                 success: function(data){
  13.                     $.each(data, function (id, count) {
  14.                       $("#"+id).html(count);
  15.                     }
  16.  
  17.                 },
  18.                 error: function(xhr, ajaxOptions, thrownError){
  19.                   alert(xhr.status);
  20.                   alert(thrownError);
  21.                 }
  22.             });
  23.         }
  24.     }
  25. </script>
Add Comment
Please, Sign In to add comment