Changeset 502 for pro-violet-viettel/sourcecode/assets/js
- Timestamp:
- Nov 14, 2014 4:19:21 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/assets/js/frontend/user.js
r490 r502 1 1 function updateInfo(us_id){ 2 $("#updating").css("display", "block"); 2 3 $.ajax({ 3 4 url: 'update_user/' + us_id, … … 6 7 success: function (data, textStatus, jqXHR) 7 8 { 9 $("#updating").css("display", "none"); 8 10 result = jQuery.parseJSON(data); 9 11 if (result.success == "1") 10 12 { 11 window.location.reload(true); 13 $("#updateInfoSuccess").modal('show'); 14 //$("#close").click(function(){window.location.reload(true)}); 15 $('#updateInfoSuccess').on('hidden.bs.modal', function () { 16 window.location.reload(true); 17 }); 12 18 } 13 19 else … … 41 47 event.preventDefault(); 42 48 }); 49 50 function changePassword(us_id) 51 { 52 $('#passwd_old_err').html(""); 53 $('#passwd_new_err').html(""); 54 $('#confirm_passwd_new_err').html(""); 55 $.ajax({ 56 url: 'change_password/' + us_id, 57 type: 'POST', 58 data: $("#frm2").serialize(), 59 success: function (data, textStatus, jqXHR) 60 { 61 result = jQuery.parseJSON(data); 62 if (result.success == "1") 63 { 64 $("#changePassSuccess").modal('show'); 65 } 66 else 67 { 68 for (var key in result.errors) 69 { 70 $('#'+key).html(result.errors[key]); 71 } 72 } 73 } 74 }); 75 } 76 77 function clearFormFields(id){ 78 $(id).find('input:text, input:hidden, input:password, input:file, select, textarea').val(''); 79 $(id).find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected'); 80 $(id).find('.help-block').html(""); 81 } 82 83 $('body').on('hidden.bs.modal', '.modal', function () { 84 clearFormFields('#frm2'); 85 });
Note: See TracChangeset
for help on using the changeset viewer.