Guest User

Untitled

a guest
May 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // JavaScript Document
  2. $(function() {
  3.   $('#user_search').live("keyup", function() {
  4.     var value = $(this).val();
  5.     SearchStudent(value)
  6.   });
  7.  
  8.   $("#student_search_dialog").dialog ({
  9.     autoOpen: false,
  10.     modal: true,
  11.     resizeable: false,
  12.     buttons: {
  13.     "Ok": function() {
  14.       var formdata = $("#StudentChangepw").serialize();
  15.       $.post("/students/change-pw/format/json",formdata, function(data,textStatus)
  16.       {
  17.         if(data.result){
  18.           $("#student_search_dialog").dialog('close');
  19.         }
  20.       }, "json");
  21.     },
  22.     "Cancel": function () {$(this).dialog("close");}
  23.     },
  24.   });
  25.  
  26.   $("a.student_edit").live("click", function() {
  27.     var a = $(this).text();
  28.     $("#student_uid").val(a);
  29.     $("#student_search_dialog").dialog("open")
  30.   });
  31.  
  32.   //Make it look like its loading
  33.   $('#user_search').fadeOut();
  34.   $('#student-lookup-results').html('<div style="margin: auto; width: 50px;"><img     src="img/ajaxloader.gif" alt="Loading..." /></div>');
  35.   $('#students-lookup-results').fadeIn();
  36.  
  37. });
  38.  
  39. function SearchStudent(val) {
  40.   $.ajax ({
  41.     type: "GET",
  42.     url: "/students/lookup/un/"+val+"/format/html",
  43.     success: function(t) {
  44.       $('#student-lookup-results').html(t);
  45.     }
  46.   });
  47. }
Add Comment
Please, Sign In to add comment