Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 747951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:15:51+00:00 2026-05-14T14:15:51+00:00

I’m having a really irritating problem doing something that I’m sure I’ve done before.

  • 0

I’m having a really irritating problem doing something that I’m sure I’ve done before. The setup is this:

  • There’s a form which is submitted via a “click” handler on a button, though the submit is ultimately a simple call to the form’s native submit() function.
  • The form’s target is an iframe, which is initially filled with an empty page (that is, its source object is an URL for an empty page). That is, the “target” attribute of the form is the same identifier (and yes, it’s a valid identifier) as the “name” and “id” attributes of the iframe (and yes, it’s unique)

Now the goal of this setup is as follows: the form contains file upload fields. Should something be wrong with one of the files uploaded, the server will report back an error. If the error response (that is, the html page with a new copy of the form, along with appropriate error messages) were to be allowed to reload the original window, then the file input fields would be cleared. That’s not good.

Thus the form submits to the iframe, so that the response from the server can be a small page that knows it’s in that hidden iframe, and knows to move the error messages up to the form.

One more thing: the form itself is also in an iframe, as part of a popup modal dialog (like a jQuery UI dialog, only slightly different; same idea though).

The setup works fine – on the first submit. In other words, if I supply nice happy files to upload, the server ships back the successful response, and the dialog is closed correctly. If I send a bogus file, the server responds with an error page that correctly copies its stuff up to the form page.

On the second submit, however (like, if I fix the bogus file input field), the browser insists on sending the server response to a new browser tab. As far as I can tell, the form’s “target” remains correct, the iframe “name” and “id” attributes aren’t changed, and I even make sure to update the hidden iframe “window.name” and “window.id” values. None of that is helping; I always get a new browser tab.

I’m trying to set up a slightly simpler test case to see if I can rule out some of my framework code (the stuff that does the submit), though via a few console.log() calls I think that stuff is OK; it’s certainly OK on all the other dialogs etc. in the site. When/if I create a simpler version I’ll post it. In the meantime, if any of you insanely smart people recognize this situation and know of a trick to make it work, I’d be really thankful.

I see the same behavior in both Firefox (3.6) and Chrome, so it’s got to be my problem and not a browser quirk (well, at least that’s what I think to be true).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:15:51+00:00Added an answer on May 14, 2026 at 2:15 pm

    Well somehow my secondary “target” iframe seems to be losing it’s “name” attribute, though I don’t know how or when that happens. The <iframe> element itself still has the correct name, but the “window” object inside does not – even though code is trying to set it.

    I am able to hack around the weirdness for now by having that “submit” code check for a targetted form, find the target iframe, and then make sure that its contentWindow has a “name” value that matches the “name” attribute on the iframe. How/why I have to do that, I don’t know, and I’m sure it’s due to something else I’m doing wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 385k
  • Answers 385k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Using Zip files with Adobe Air, Flex and Flash |… May 14, 2026 at 11:37 pm
  • Editorial Team
    Editorial Team added an answer The error has nothing to do with your inner class.… May 14, 2026 at 11:37 pm
  • Editorial Team
    Editorial Team added an answer Add a pre-build action to delete: %USERPROFILE%\Local Settings\Application Data\[AppName]\...\[Version]\user.config or… May 14, 2026 at 11:37 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.