PDA

View Full Version : window.toolbar..????


Juls
01-03-2002, 12:15 PM
Hi,

I am lost please help!!!

I have an asp page that first validates a form onsubmit and then submits a form to another asp page. When this form submits I open a new window for this next page and would like to set toolbar and menubar of this new window to 0.

However .... after many different combinations I came to the conclusion that this is not possible unless you use window.open method. I tried to use self.toolbar but got an error saying it's not being recognized as valid.
I also tried running my validate function and then the function that submits the form with the action.... but nothing.

Is there a way to set these window properties at the time of opening it?

Thanks so much,
Juls

SirWeb
01-03-2002, 12:41 PM
I don't know if this will help but I use this javascript all the time for something like that.

<SCRIPT LANGUAGE="JavaScript">
function NewWindow(mypage, myname, w, h, scroll)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'

win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4)
{
win.window.focus();
}
}
</script>

I hope it helps!! :)

Juls
01-03-2002, 12:58 PM
Thanks,

BUT I need to submit a form, not just open a new window with the set window parameters.
I already tried a function similar to yours, but I am r4eally looking to run my validate function and then submit form to new window while setting it's properties.

scoutt
01-03-2002, 01:29 PM
the only way you can change the window parameters is by opening a popup window. of course that would be window.open. then set toolbar=0 and whatever else you want. you will have to submit, validate, then open new window. is that what you are after?

Jon Hanlon
01-03-2002, 05:25 PM
All Javascript can do is open a new window, with or without toolbars.
It is not possible to change the toolbars on a currently open window. Otherwise rogue designers could trap people in their sites by removing navigation buttons etc.

Juls
01-10-2002, 03:49 PM
Originally posted by scoutt
the only way you can change the window parameters is by opening a popup window. of course that would be window.open. then set toolbar=0 and whatever else you want. you will have to submit, validate, then open new window. is that what you are after?

That is exactly what I want... submit, validate and open new window while at that time setting toolbar=0.
However I seem to be having a problem with this.

Onsubmit in my form tag i call validate function which can return either false if there is a problem or true if there isn't. After this I can't seem to get a right way to submit the form and open a new window.


PLEASE HELP!!!!!!

Juls