-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.js
34 lines (27 loc) · 939 Bytes
/
profile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$("#update-pass").click(function() {
parent.location='./forgot-password-page.php';
});
// Ajax call to updateusername.php
$("#updateusernameform").submit(function(event){
//prevent default php processing
event.preventDefault();
//collect user inputs
var datatopost = $(this).serializeArray();
console.log(datatopost);
//send them to updateusername.php using AJAX
$.ajax({
url: "updateusername.php",
type: "POST",
data: datatopost,
success: function(data){
if(data){
$("#updateusernamemessage").html(data);
}else{
location.reload();
}
},
error: function(){
$("#updateusernamemessage").html("<div class='alert alert-danger'>There was an error with the Ajax Call. Please try again later.</div>");
}
});
});