Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms and sizing

Status
Not open for further replies.

nmath

Programmer
Dec 12, 2003
47
US
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]
 
the short answer is you open a window with a name, and post your form using target="name"

similar to

var win = window.open("", "formWin", "height=300,width=300");
document.myForm.target = "formWin";
document.myForm.submit();



=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
So you're just trying to resize the window? What's wrong with self.resizeTo(640,480) ?

Adam
while(ignorance==true){perpetuate(violence,fear,hatred);life--};
 
Guess I missed what was being asked...

Adam
while(ignorance==true){perpetuate(violence,fear,hatred);life--};
 
I have a form that gets two variables from user. I want to pass these two variables to a pup up window at the time the user click the submit button. then do some Database check on them in that new window and transfer to new window.

window#1 ----> pup up window ----> window #2
Any sugestion?

thanks
Moj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top