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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submiting to a new window 1

Status
Not open for further replies.

Gatorajc

MIS
Mar 1, 2002
423
US
If you read the Javascript forum you have seen this so forgive me. Anyway.

I have a page that submits to a new page then closes. The problem that I am having (actually it is more annoying than a problem) is that it seems to open twice. It opens the new window seems to redirect to the same page. This is what the code looks like.

<form method=&quot;post&quot; action=&quot;letter_selection.asp&quot; name=&quot;unit&userid_info&quot; target = &quot;NWWINDOW&quot;>

** additional code in here **

function NewWindow()
{
NWWINDOW=window.open('letter_selection.asp','NWWINDOW','toolbar=no,status=no,
width=400,height=500');
window.close();
}

After some trouble shooting it I found it opens the new window using the function then it submits the form making it look like it redirects. I know this because in the new window you can go back and it is the same page. What I want to know is how get it to open the new window and submit at the same time.

*** Before anyone freaks this is for an intranet site and part of a workflow system. So I'm not being annoying closing the original window. It works better with it closed. *** AJ
I would lose my head if it wasn't attached. [roll1]
 
why not ad the response.redirect into the asp page after the code is finished processing and get rid of the javascript function all together?

[bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Are you suggesting something like a redirect page. I thought about that but I want to new window to be a certain size and look and I do not know how to do that with asp. AJ
I would lose my head if it wasn't attached. [roll1]
 
you can redirect with the properties the way you want them like this
RetVal=&quot;authtest_2.asp&quot;

RetFeatures = &quot;dialogWidth:300px;status:no;dialogHeight:200px;scroll:no;resizable:no&quot;

x = window.showModalDialog (CStr(RetVal),,CStr(RetFeatures))

[bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Thanks onpnt. You showed me I still have a lot to learn I had no idea you could do that. AJ
I would lose my head if it wasn't attached. [roll1]
 
Glad I could help Gatorajc

thanks for the star [thumbsup2] [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top