Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: a tale of 2 Forms


Message #1 by speedguru@m... on Thu, 29 Mar 2001 16:38:07
Hi, 
Try this:
Take out the target="_blank" on the first <form> tag. It can't find a window
with this target name so it's creating one for you.

> From: speedguru@m...
> Reply-To: "javascript" <javascript@p...>
> Date: Thu, 29 Mar 2001 16:38:07
> To: "javascript" <javascript@p...>
> Subject: [javascript] a tale of 2 Forms
> 
> hi
> 
> I have 2 forms. i'm submitting the first form using document.form1.submit()
> using when the form onLoad.. & sending a hidden variable that updates a
> table..
> 
> The second form stays in the main page for further processing. Problem is the
> first form opens up in a new window...
> 
> I want the updation to happen without a new window being opened if possible (i
> know thats kind of funny)...or to be closed immediately..
> 
> 
> i used this
> <body onLoad="document.form1.submit()">
> <form name=form1 action=updateAndClose.asp target="_blank">
> and put a <body onLoad='setTimeout("window.close()",1000)'> in
> updateAndclose.asp but it is asking for a confirmation message...which i guess
> means its not a child window.
> 
> i want it to close automatically.....
> 
> To avoid the ACTION page on submitting the second form...i tried this
> 
> <frameset rows="60%,35%,5%" border=0 scrolling=no>
> <frame name="frame1" src="frame1.htm" scrolling=no>
> <frame name="frame2" src="frame2.htm" scrolling=no>
> <frame name="frame3" >
> </frameset>
> & tried the following in frame2.html
> <form name="form2" method="post" action="updateAndClose.asp" target="frame3"
> >
> I was on cloud #9 when this worked in IE until I checked it in Nutscape.
> updateAndClose.asp opens up in a new window and not in frame3. Whats wrong
> with Nutscape .....
> whats the workaround ?
> 
> Any solution to this or any alternatives would be highly appreciated..
> 
> Need help urgently....
> 
> 

  Return to Index