creating a copy button

drashrafsabry

Well-known member
You are using DaDaBIK version 9.4-Monterosso enterprise, installed on 28-08-2019 (installation code: 148365d65d2e52eebe), the latest version of DaDaBIK is 10.2-Manarola released on 15-07-2020

i used to have a button to copy contents of a field from a dropdown list to textbox area. used to work now not

in custom_functions.php

$cnt=0;
$custom_buttons['Reports'][$cnt]['type'] = 'javascript';
$custom_buttons['Reports'][$cnt]['callback_function'] = 'dadabik_copy_report';
$custom_buttons['Reports'][$cnt]['permission_needed'] = 'insert';
$custom_buttons['Reports'][$cnt]['show_in'][] = 'insert_form';
$custom_buttons['Reports'][$cnt]['position_form'] = 'Report_Template';
$custom_buttons['Reports'][$cnt]['label_type'] = 'fixed';
$custom_buttons['Reports'][$cnt]['label'] = 'Copy Template To Report Box';
$custom_buttons['Reports'][$cnt]['style'] = 'background:#4cc0b5;width:250px';
$cnt++;

in custom_functions.js

function dadabik_copy_report(field)
{
selectedindex = $('[name="Report_Template"]')[0].selectedIndex;
var mytext = $('[name="Report_Template"]')[0][selectedindex].text;
var mytext_2 = mytext.replace(/<br>/gi, "\n");
$('[name="Report"]')[0].value = mytext_2;
}


nothing changed , field names and table are the same.
 
Top