birdycarolyn
Technical User
Hello Experts,
I'm very new to Javascript and was hoping someone could help me out. I have 2 buttons on a form that return results from a database and each Action and Target is set dynamically by the following code:
In function OnButton2(), the target is set to _blank which is what I want, but at the same time I would like to incorporate the Window.Open command to control how the window opens and it's width and height:
Does anyone know how I can incorporate the 2? As a bonus, does anyone know how I can keep sending my data to the opened blank window so that I don't have many windows opened every time they choose the button (in other words, keep the focus on that window while refreshing the data table within it)?
I hope I am being clear and appreciate any help! Carolyn
I'm very new to Javascript and was hoping someone could help me out. I have 2 buttons on a form that return results from a database and each Action and Target is set dynamically by the following code:
Code:
<INPUT type="button" value="View Results" name=button1 onclick="return OnButton1();">
<INPUT type="button" value="Printer Friendly" name=button2 onclick="return OnButton2();">
function OnButton1()
{ document.Form1.action = "results_vr1.asp";
document.Form1.target = "_self";
document.Form1.submit();
return true;
}
function OnButton2()
{ document.Form1.action = "results_vr2.asp"
document.Form1.target = "_blank";
document.Form1.submit();
return true;
}
In function OnButton2(), the target is set to _blank which is what I want, but at the same time I would like to incorporate the Window.Open command to control how the window opens and it's width and height:
Code:
window.open("results_vr2.asp", "newwindow", "resizeable=yes,scrollbars=yes,toolbar=yes,menubar=yes,width=750,height=550,innerWidth=750,innerHeight=550,left=0,top=0");
I hope I am being clear and appreciate any help! Carolyn