/    Sign up×
Community /Pin to ProfileBookmark

iframe from submits to new page

Hello, I’ve messed with this for a while now and I give up. I’m not a javascript guru, so I come to you.

I have a page with an iframe on it.
This frame has a small form and nothing else.
When I click on the submit button I need it to submit to another page

Here’s what I have…

[code]

<form method=”get” name=”thisform” action=”http://www.example.com”>
<input type=”text” name=”variable1″ size=”20″>
<input type=”button” value=”go” onclick=”window.open(document.thisform.action); thisform.submit();”>

[/code]

What am I doing wrong? How do I submit to a new window rather than the iframe where the form is?

Thanks

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@CharlesDec 31.2004 — [font=monospace]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Example</title>

</head>

<body>

<form method="get" name="thisform" action="http://www.example.com" target="_blank">

<input type="text" name="variable1" size="20">

<button type="submit">Go</button>

</body>

</html>[/font]

You don't do this with JavaScript, you simple use the "[url=http://www.w3.org/TR/html401/present/frames.html#adef-target]target[/url]" attribute. However, you will need to use a Transitional DTD to use the "target" attribute.
Copy linkTweet thisAlerts:
@carruchaauthorDec 31.2004 — I thought it would be easier than I was making it. Thanks, worked great!
×

Success!

Help @carrucha 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,
)...