By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

Target for form to open in same window

P: n/a
I just want my form target to be another page but open it in the same
window. Here is my code for the 2 pages :

-------------------------------form1.htm------------------------------------
<html>
<body>
This is form 1
<form ACTION="form2.htm" METHOD="POST" target="self">
<input type="submit" value="Submit">
</form>
</body>
</html>
-------------------------------form2.htm------------------------------------
<html>
<body>
This is form 2
<form ACTION="form1.htm" METHOD="POST" target="self">
<input type="submit" value="Submit">
</form>
</body>
</html>
----------------------------------------------------------------------------
--

You'd think the same window would just switch pages back and forth as you
clicked the submit buttons but it doesn't work. Not only does the new form
open in a seperate window but it then claims that it is an invalid address
and won't display the page.

http://www.mississippiprinting.com/MPCNew/form1.htm

http://www.mississippiprinting.com/MPCNew/form2.htm

This is a stripped down example. I actually have a series of forms, the
acatual forms that come up are determined by the choices the user makes
within the previous forms. It is all working fine if I open separate windows
for each form/page but I'd prefer if they just opened in the same window.

What simple thing have I missed here? Thanks!


Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Mon, 14 Jun 2004 15:11:01 GMT, Simon Wigzell wrote:
<form ACTION="form2.htm" METHOD="POST" target="self">


You did not validate this as HTML, did you?
<http://www.w3.org/TR/1999/REC-html401-19991224/types.html#idx-target_frame>

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #2

P: n/a
Andrew Thompson wrote:
On Mon, 14 Jun 2004 15:11:01 GMT, Simon Wigzell wrote:
<form ACTION="form2.htm" METHOD="POST" target="self">


You did not validate this as HTML, did you?

<http://www.w3.org/TR/1999/REC-html401-19991224/types.html#idx-target_frame>

Validating would not help in this case.

(a) The DTD does not express the rules for frame target names
(b) "self" is a valid frame target name (it has a different meaning to
"_self", but is still acceptable)

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #3

P: n/a
On Mon, 14 Jun 2004 22:06:19 +0100, David Dorward wrote:
(b) "self" is a valid frame target name (it has a different meaning to
"_self", but is still acceptable)


...uggh! (slaps forehead) Good point.

(grumbles) Knew I shoulda' just called for
a link and been done with it, but no, I had
to be 'clever' as well..

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.