Changing connection name from blank application

I am using blank application as a main page with a navigation bar and iframes. Menu applications are linked in these iframes and grids and forms are linked in these menu applications as well.

I want to change connection name for all forms on button click. The button should be at the main page.
Here is what I’ve tried,
I created a button on my blank application which passes parameters in the url. sc global value assigned based on the url parameter.
if(isset($_GET[‘editmode’]) && $_GET[‘editmode’] == ‘on’){
[editMode] = ‘on’;
}
else {
[editMode] = ‘off’;
}
I created a library which applies in all forms.
if(isset([editMode])){
if([editMode] == “off”){
sc_change_connection(“conn_mysql”, “conn_mysql_read”);
echo “off”;
}
else if([editMode] == “on”){
sc_reset_change_connection();
echo “on”;
}
else {
sc_change_connection(“conn_mysql”, “conn_mysql_read”);
echo “off”;
}
}
Depending on the global, the connection name is changed as long as the main page reloads. All works fine! But only reloading is disturbing one. global value is changing on page reload only. On every page reload, the user should have to open the form again. :frowning:
Please help!!! Is there any other way to change connection name for all forms in the application with one button? Or is there a way to change global value without reloading the page?