Focus error field after validation.

This commit is contained in:
takezoe
2014-03-15 16:37:43 +09:00
parent d86f40e3a2
commit a64207f0ec

View File

@@ -34,3 +34,14 @@ $(function(){
// syntax highlighting by google-code-prettify
prettyPrint();
});
function displayErrors(data){
var i = 0;
$.each(data, function(key, value){
$('#error-' + key.split(".").join("_")).text(value);
if(i == 0){
$('#' + key).focus();
}
i++;
});
}