Created
June 9, 2010 19:30
-
-
Save atuttle/432050 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//update-form handler | |
$("##update").submit(function(e){ | |
e.preventDefault(); | |
var frm = $(this); | |
$.ajax({ | |
url: frm.attr('action'), | |
data:{ | |
firstname: $("##update input[name=firstname]").val(), | |
lastname: $("##update input[name=lastname]").val(), | |
address: $("##update input[name=address]").val(), | |
city: $("##update input[name=city]").val(), | |
state: $("##update input[name=state]").val(), | |
postalcode: $("##update input[name=postalcode]").val(), | |
email: $("##update input[name=email]").val(), | |
phone: $("##update input[name=phone]").val(), | |
fax: $("##update input[name=fax]").val(), | |
thepassword: $("##update input[name=thepassword]").val() | |
}, | |
type: frm.attr('method'), | |
dataType: "json", | |
contentType: "application/json", | |
success: function (data, textStatus, xhr){ | |
console.log(data); | |
reloadData(); | |
}, | |
error: function (xhr, textStatus, err){ | |
console.log(textStatus); | |
console.log(err); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment