mirror of
https://github.com/nextcloud/server.git
synced 2026-03-01 04:50:40 -05:00
Mark form field with error message
This commit is contained in:
parent
8826aa8056
commit
0dd5fd5cd3
2 changed files with 11 additions and 1 deletions
|
|
@ -1,2 +1,4 @@
|
|||
#task_details th { padding:2px; text-align:right ;vertical-align:top; }
|
||||
#task_details td { padding:2px; text-align:left ;vertical-align:top; }
|
||||
.error_msg{color:red;}
|
||||
.error{border-color:red;border-width:2px;}
|
||||
|
|
|
|||
|
|
@ -92,12 +92,20 @@ $(document).ready(function(){
|
|||
|
||||
$('#tasks_edittaskform input[type="submit"]').live('click',function(){
|
||||
$.post('ajax/edittask.php',$('#tasks_edittaskform').serialize(),function(jsondata){
|
||||
$('.error_msg').remove();
|
||||
$('.error').removeClass('error');
|
||||
if(jsondata.status == 'success'){
|
||||
$('#task_details').data('id',jsondata.data.id);
|
||||
$('#task_details').html(jsondata.data.page);
|
||||
}
|
||||
else{
|
||||
alert(jsondata.data.errors);//TODO
|
||||
var errors = jsondata.data.errors;
|
||||
for (k in errors){
|
||||
$('#'+k).addClass('error')
|
||||
.after('<span class="error_msg">'+errors[k]+'</span>');
|
||||
}
|
||||
$('.error_msg').effect('highlight', {}, 3000);
|
||||
$('.error').effect('highlight', {}, 3000);
|
||||
}
|
||||
}, 'json');
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue