Page 1 of 1

Show Error in Modal Window with Field Caption

Posted: 2020-02-28 11:22
by zibrahim
Hi there,
I am new here and hope somebody can help me.
I am trying to get the field caption in the error modal window instead of the field name.
The code I used in the hooks file is something familiar like below

function show_error(field, msg){
modal_window({
message: '<div class="alert alert-danger">' + msg + '</div>',
title: 'Error in ' + field,
close: function(){
$j('#' + field).focus();
$j('#' + field).parents('.form-group').addClass('has-error');
}
});
return false;
}

Appreciate if someone can help me.
Thanks.