Confirmation message

PdePutter

New member
Hello,

Just recently I began using the custom button part of DaDaBIK and I must say, it is good.
However, there is something I am struggling with. The documentation says it is possible to show a confirmation message to the user with the following code:

Starting from DaDaBIK v. 11.1, your php_ajax functions can also return a message (for example a confirmation message or an error message) to show after the execution of the code. Here is an example of how to use the new feature:

function dadabik_change_status_2($table_name, $where_field, $where_value)
{
......your code...........
if (..everything was fine....){
$_cp_return['message'] = 'The status has been changed';
$_cp_return['class_message'] = 'msg_ok';
}
else{
$_cp_return['message'] = 'Unexpected error, the status cannot be changed';
$_cp_return['class_message'] = 'msg_error';
}
return $_cp_return;
}
(See chapter 10.7, for this...)
https://dadabik.com/index.php?function=show_documentation#low_coding_buttons

However, I cannot get this to work.
1. I have no way to get a php-ajax function to work. According to w3school.com it should utilize the "XMLHttpRequest" object. I have not seen any samples in dadabik.
2. Returning the $_cp_return does not fire the confirmation message..

Would anybody be able to point me in the right direction?

Thanks..
Peter
 
Top