/    Sign up×
Community /Pin to ProfileBookmark

Problem submitting a form from within an <iframe>

Hi all,

I’m using an iframe on my site for the main content.

Evereything works just fine EXCEPT… I can’t seem to submit a form from within the iframe.

Here is an extract from the html…

<form name=”lookup” action=”http://www.[name_of_site_]/search.jsp” METHOD=”post”>
<input type=”text” name=”domain.name” size=15>
<input type=”hidden” name=”domain.tld.com” value=”OK” checked>
<a href=”javascript:document.lookup.submit()”>Go!</a>
</form>

Note that the form submits a name and the .com tld to our domain names reseller page, and I don’t want to use this forum as some sort of backhand promotion vehicle, so I’ve left the [name_of_site] out.

Here’s the problem…

When the page is run on its own, it works as per spec. When the page is laoded into an iframe (called “content”) and the user clicks Go!, it loads the target page, but does not submit the data.

Any suggestions?

Thanks
IB

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliOct 14.2003 — how about this...

<a href="#" onclick="document.lookup.submit(); return false;">Go!</a>
Copy linkTweet thisAlerts:
@chestertbauthorOct 14.2003 — Nope.

Sorry. That didn't fix it. Same effect. As a stand alone, the page submits just fine. Once in the iframe, it just doesn't send the data.

I've noted that the name of the text field to be submitted is "domain.name", and this is out of my control. Could it be the fieldname that is stuffing it up?

Or...

should I try putting the submit function on the top page and submitting from there, and if so, how do I read the data in the iframe form from the top page?

IB
×

Success!

Help @chestertb 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.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...