Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // JavaScript Document
- $(function() {
- $('#user_search').live("keyup", function() {
- var value = $(this).val();
- SearchStudent(value)
- });
- $("#student_search_dialog").dialog ({
- autoOpen: false,
- modal: true,
- resizeable: false,
- buttons: {
- "Ok": function() {
- var formdata = $("#StudentChangepw").serialize();
- $.post("/students/change-pw/format/json",formdata, function(data,textStatus)
- {
- if(data.result){
- $("#student_search_dialog").dialog('close');
- }
- }, "json");
- },
- "Cancel": function () {$(this).dialog("close");}
- },
- });
- $("a.student_edit").live("click", function() {
- var a = $(this).text();
- $("#student_uid").val(a);
- $("#student_search_dialog").dialog("open")
- });
- //Make it look like its loading
- $('#user_search').fadeOut();
- $('#student-lookup-results').html('<div style="margin: auto; width: 50px;"><img src="img/ajaxloader.gif" alt="Loading..." /></div>');
- $('#students-lookup-results').fadeIn();
- });
- function SearchStudent(val) {
- $.ajax ({
- type: "GET",
- url: "/students/lookup/un/"+val+"/format/html",
- success: function(t) {
- $('#student-lookup-results').html(t);
- }
- });
- }
Add Comment
Please, Sign In to add comment