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

  • Home
  • SEARCH
  • 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 6977603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:38:49+00:00 2026-05-27T17:38:49+00:00

This seemed so trivial when I started off with it! My objective is this:

  • 0

This seemed so trivial when I started off with it! My objective is this:

  • When user clicks on a button, open up a form in a new window.
  • Once the form is submitted, close the popup and return to the original page. The reverse order is fine too – i.e., I am okay if the popup is closed and then the form submits.

Here’s how I’m doing this:

<form action="/system/wpacert" method="post" enctype="multipart/form-data" onsubmit="return closeSelf()" name="certform">
                <div>Certificate 1: <input type="file" name="cert1"/></div>
                <div>Certificate 2: <input type="file" name="cert2"/></div>
                <div>Certificate 3: <input type="file" name="cert3"/></div>

                <div><input type="submit" value="Upload"/></div>
            </form>

and the Javascript looks like this:

<script type="text/javascript">
function closeSelf(){
    self.close();
    return true;
}
</script>

This seems to work fine on IE8 and Chrome; but Firefox refuses to submit the form; it just closes the popup. What might I be doing wrong?

EDIT:

Had forgotten to post the code the opens the popup. Here it is:

<div><input type="submit" value="Upload Certificates" onclick="popupUploadForm()"/>

And the corresponding javascript:

function popupUploadForm(){
        var newWindow = window.open('/cert.html', 'name', 'height=500,width=600');
    }
  • 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-27T17:38:50+00:00Added an answer on May 27, 2026 at 5:38 pm

    I have executed the code in my machine its working for IE and FF also.

    function closeSelf(){
        // do something
    
        if(condition satisfied){
           alert("conditions satisfied, submiting the form.");
           document.forms['certform'].submit();
           window.close();
        }else{
           alert("conditions not satisfied, returning to form");    
        }
    }
    
    
    <form action="/system/wpacert" method="post" enctype="multipart/form-data" name="certform">
           <div>Certificate 1: <input type="file" name="cert1"/></div>
           <div>Certificate 2: <input type="file" name="cert2"/></div>
           <div>Certificate 3: <input type="file" name="cert3"/></div>
    
           // change the submit button to normal button
           <div><input type="button" value="Upload"  onclick="closeSelf();"/></div>
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seemed to be working perfectly, I added a checkbox to my form so
I create a map using new MapMaker().softValues().maximumSize(cacheSize).makeMap(); This seemed to work fine, however, I
I have some trivial code that looks like this: SortedDictionary<String, long> d = new
This seemed easier in Web Forms; I'd have a user control, with the logic
This seemed like an easy thing to do. I just wanted to pop up
This seemed to spark a bit of conversation on another question and I thought
This seemed like it should be easy, but I have had trouble getting it
In linking a sports event to two teams, at first this seemed to make
This one has me puzzled. It seemed like an easy task, but the solution
When I set out this morning the task seemed simple: build a list of

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.