Hi together... now I have another problem
I added a checkbox called "Zeige_Vorlage". When it is unchecked the Beispieltext-Dropdown (Programm_Vorlage in AG) is not shown and if checked Beispieltext-Dropdown is shown. Checking and unchecking is working well with my programm-dv.js hook which I found elsewhere in the forum here.
I made an entry in the before_insert hook:
$prog1 = $_GET['Progrann_Vorlage'];
if ((!isset($prog1)) || ($prog1 != NULL)){
$data['Prozess']=sqlvalue("select Prozess from db_programm where id={$data['Programm_Vorlage']}");
$data['Programm_Vorlage'] = NULL;
return TRUE;
and in the before_update hook:
$prog1 = $_GET['Programm_Vorlage'];
if ('Programm_Vorlage' != NULL)
$data['Prozess']=sqlvalue("select Prozess from db_programm where id={$data['Programm_Vorlage']}");
$data['Programm_Vorlage'] = NULL;
return TRUE;
and it gets the correct selected templates in the field "Prozess" on saving. But when I try to change the text in "Prozess" and click on "save" I get the data from the origin template. Also on a new dataset when I don't click the checkbox to use a template and edit "Prozess" whith individual data, there is only saved a "NULL" on "Prozess".
What I want is a dropdown field, which is only shown when the checkbox "Zeige_Vorlagen" is checked. And when it is checked I would like to select a text template from the dropdown which fills my other fields (like my first posting above) upon saving. I don't now if I'm using the "if clauses" right?
Could someone help me? Maybe @pböttcher because your tip above worked fine
Regards
Marcus