Show Error in Modal Window with Field Caption

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
zibrahim
Veteran Member
Posts: 137
Joined: 2020-01-28 18:30
Location: Malaysia

Show Error in Modal Window with Field Caption

Post by zibrahim » 2020-02-28 11:22

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.
Zala.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.

Post Reply