Advertisement
Guest User

Untitled

a guest
Jan 24th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(id){
  2.       var users = json.Users[id];
  3.  
  4.       users.tempId = id;
  5.       utils.loadTemplate(
  6.         'tpl/forms/privilegesForm.html',
  7.         users,
  8.         function(template){
  9.           var submitButton = $('.input-fields-' + id + ' .submit-button'),
  10.               $formUserName = $('.input-fields-' + id +' #user-name'),
  11.               $formUserRole = $('.input-fields-' + id +' #user-role');
  12.  
  13.           console.log(users.tempId);
  14.           submitButton.on('click',function(eventData){
  15.             utils.sendData('http://localhost:8081/myForum/privilegesForm',{
  16.               userName: $formUserName.val(),
  17.               userRole: $formUserRole.val()
  18.             },function(response){
  19.               console.log(response);
  20.               if(response.success == 'true'){
  21.                //
  22.                alert('Done!');
  23.              }else{
  24.               alert('Something went wrong');
  25.             }
  26.           });
  27.           });
  28.         }
  29.       );
  30.     })(i);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement