/    Sign up×
Community /Pin to ProfileBookmark

POST to a New Window

I can use a form to post data to a new window using this approach:

<form action=”window2.php” method=”post” target=”_blank”>
<input type=”submit” id=”submit” name=”submit” value=”Some_Info” />
</form>

However, this will not validate as XHTML Strict because “target” is not an XHTML Strict attribute.

Is there some other way that will validate?

Thanks!

Mike

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KarterJKOct 08.2005 — you are essentially openiing a popup window

you could use the onsubmit open a new window.

<form method="post" onsubmit="window.open('window2.php','mywindow')">

<input type="submit" id="submit" name="submit" value="Some_Info" />

</form>[/QUOTE]

with window open you can size the window and place it where ever you want on the screen

window.open("window2.php","anyname",width="200",height="500",resizable=0,scrollbars=0,left=20,top=20,screenX=20,screenY=20')


width & height are the outside dimensions

top & left are IE placement

screenX & screenY are NetScape placement

resizable 0 = no 1 = yes or false true

scrollbars on side 0 = now 1 = yes or you can say auto
Copy linkTweet thisAlerts:
@mwandawauthorOct 08.2005 — Thanks for the reply, KarterJK.

The onsubmit="window.open...." approach does indeed open a new window. Unfortunately, it does not post the data to that window, and that is what I am trying to do. Using target="_blank" works, but it isn't valid XHTML Strict.
Copy linkTweet thisAlerts:
@KarterJKOct 09.2005 — are you passing the arguments

example

window2.php?name=whatever&id=whatever
Copy linkTweet thisAlerts:
@mwandawauthorOct 09.2005 — Yes, I will be passing arguements, but I do not want to include them in the URL. I want to POST them.

"Vladdy" on another forum made a very good point, saying that "Strict" DTDs are meant to function on the widest possible variety of viewers, some of which do not have a window object. For that reason, the "target" attribute is not included in the "Strict" DTDs.

I will probably have to concede that Strict XHTML is not the most appropriate DTD in this case.

Another possibility comes from the fact that the "X" in XHTML means "eXtensible." I could add the "Target" module to the XHTML DTD used for this particular site.

Thanks,

Mike
×

Success!

Help @mwandaw spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...