I have a main form 1, and open form 2 from a button by OpenFormInFrame.
I want to send the new RECORD_ID back from the modal window (new record table 2) to form 1 as a preset value for a lookup.
I can update a field on the form in the modal window with the RECORD ID by using nuSetHash and nuGetHash in the AFTERSAVE php code, but it seems that the hash variable is not available to the form 1 as soon as I close the modal window (manually or by nuRemoveModal).
Code: Select all
//update field in many-to-many link table
$id = nuID();
$sql = "
INSERT INTO transcr_geneMMlink (transcr_gene_id, gene_idFK, transcr_idFK, comm)
VALUES ('$id','#gene_idFK#', '#RECORD_ID#', 'auto from primer')
";
nuRunQuery($sql);
]$js = "
alert('Transcript saved succesfully!');
nuSetHash('trans','#RECORD_ID#');
var tr = nuGetHash('trans');
alert(tr);
$('#transid').val(tr);
nuRemoveModal();
$('#pri_transidFK').val(nuGetHash('trans'));
";
nuAddJavascript($js);
How can I send data back to form 1 (without reloading since the record on form 1 has not been saved yet).
Regards, Tinka