I am having a little problem with forms and getting the page that I want to go to a certain size. Originally, I used javascript to open a new window but since the page that I open needs to post data back to the parent that called it I ran into problems. If I close the parent window using a self.close after I open a child I get an IE alert which is far less than desireable. I need to use data from a form in my ASP code which causes some problems w/ client/server issues when I use javascript. What I would like to do is resize/set attributes of a page that I post to.
If it is helpful here is the code that I use to open the window:
function whereWindow(myForm, myavailable, sURL, sName, w, h) {
choiceForm = document.getElementById(myForm);
available = document.getElementById(myavailable);
var selectedItem = choiceForm.available.selectedIndex;
var selectedText = choiceForm.available.options[selectedItem].text;
var selectedValue = choiceForm.available.options[selectedItem].value;
var selectedClass = choiceForm.available.options[selectedItem].myvalue;
// your new window's width
var w = w || 640;
// your new window's height
var h = h || 480;
var sName = sName || ("win" + new Date().getTime());
var ah = window.screen.availHeight;
var aw = window.screen.availWidth;
var l = (aw/2) - (w/2);
var t = (ah/2) - (h/2);
var sAtts = "location=no" +
",menubar=no" +
",resizable=yes" +
",scrollbars=yes" +
",status=yes" +
",toolbar=no" +
",height=" + h +
",width=" + w +
",top=" + t +
",left=" + l;
sURL = sURL + "sel="+selectedText+"&type="+selectedClass;
window.newWin = window.open(sURL, sName, sAtts);
}
I would like to apply all these attributes to a window that I open using a post.
Any suggestions would be appreciated! Thanks!![[ponder] [ponder] [ponder]](/data/assets/smilies/ponder.gif)
If it is helpful here is the code that I use to open the window:
function whereWindow(myForm, myavailable, sURL, sName, w, h) {
choiceForm = document.getElementById(myForm);
available = document.getElementById(myavailable);
var selectedItem = choiceForm.available.selectedIndex;
var selectedText = choiceForm.available.options[selectedItem].text;
var selectedValue = choiceForm.available.options[selectedItem].value;
var selectedClass = choiceForm.available.options[selectedItem].myvalue;
// your new window's width
var w = w || 640;
// your new window's height
var h = h || 480;
var sName = sName || ("win" + new Date().getTime());
var ah = window.screen.availHeight;
var aw = window.screen.availWidth;
var l = (aw/2) - (w/2);
var t = (ah/2) - (h/2);
var sAtts = "location=no" +
",menubar=no" +
",resizable=yes" +
",scrollbars=yes" +
",status=yes" +
",toolbar=no" +
",height=" + h +
",width=" + w +
",top=" + t +
",left=" + l;
sURL = sURL + "sel="+selectedText+"&type="+selectedClass;
window.newWin = window.open(sURL, sName, sAtts);
}
I would like to apply all these attributes to a window that I open using a post.
Any suggestions would be appreciated! Thanks!
![[ponder] [ponder] [ponder]](/data/assets/smilies/ponder.gif)