Ok, a question for the javascript guys I guess. I’m not very good at it. I created a container with two iframes. I put a control in container 1 and a form in container 2. I created a javascript button and added the following code to it:
parent.document.getElementById("id-iframe-widget1").src='../control/control.php?test=abc'
I tested it and it works. The first IFrame shows the current time and it changes on every click.
Now I want to do the same from php. My purpose is to refresh the first IFrame when the user changes the selection in the second IFrame application. So I added the following code to the oninit event:
echo '<script type="text/javascript">function disp_a(xfrm,xuri) { parent.document.getElementById("id-iframe-widget1").src="../control/control.php"; } </script>';
Then I applied the following code to the PHP Button:
$javascript_function = 'disp_a'; // Javascript function name
$javascript_parameters = array( // Javascript function parameters, add as many as needed
'param1',
'param2');
// Call javascript function
sc_ajax_javascript($javascript_function, $javascript_parameters);
;
But this has not the required effect. What am I doing wrong here?