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 8550977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:05:26+00:00 2026-06-11T14:05:26+00:00

I am uplaoding a JSPForm using iFrame.The code is as follows, function directConvert(form, action_url,

  • 0

I am uplaoding a JSPForm using iFrame.The code is as follows,

function directConvert(form, action_url, div_id){               
        // Create the iframe...
        var iframe = document.createElement("iframe");
        iframe.setAttribute("id", "upload_iframe");     
        iframe.setAttribute("name", "upload_iframe");
        iframe.setAttribute("width", "0");
        iframe.setAttribute("height", "0");
        iframe.setAttribute("border", "0");
        iframe.setAttribute("style", "width: 0; height: 0; border: none;");
        // Add to document...
        form.parentNode.appendChild(iframe);
        //window.frames['upload_iframe'].name = "upload_iframe";     
        iframeId = document.getElementById("upload_iframe");     
        // Add event...

        var eventHandler = function () {     
                if (iframeId.detachEvent) iframeId.detachEvent("onload", eventHandler);
                else iframeId.removeEventListener("load", eventHandler, false);             
                // Message from server...    

                if (iframeId.contentDocument) {                
                    content = iframeId.contentDocument.body.innerHTML;
                } else if (iframeId.contentWindow) {                    
                    content = iframeId.contentWindow.document.body.innerHTML;
                } else if (iframeId.document) {                 
                    content = iframeId.document.body.innerHTML;
                }               
                document.getElementById(div_id).innerHTML = content;     
                // Del the iframe...
                setTimeout('iframeId.parentNode.removeChild(iframeId)',50);
            }

        if (iframeId.addEventListener) iframeId.addEventListener("load", eventHandler, true);
        if (iframeId.attachEvent) iframeId.attachEvent("onload", eventHandler);  

        // Set properties of form...
        form.setAttribute("target", "upload_iframe");
        form.setAttribute("action", action_url);
        form.setAttribute("method", "post");
        form.setAttribute("enctype", "multipart/form-data");
        form.setAttribute("encoding", "multipart/form-data");  
        form.submit();      
    }

The Form is submitting properly but after that if there is any action like checking radio buttons in the page leads to opening the application in New Window.How to prevent it from opening in New Window?

Thanks

  • 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-06-11T14:05:27+00:00Added an answer on June 11, 2026 at 2:05 pm

    Not sure why radio buttons would cause any problem, but if the form is submitting, the problem is probably that the form ‘target’ no longer exists.

    form.setAttribute("target", "upload_iframe");
    

    The “upload_iframe” element is removed from the DOM in your load event handler. Try setting the target to “_self” once the iframe has been removed.

    Form target docs: http://www.w3schools.com/tags/att_form_target.asp

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

Sidebar

Related Questions

I uploading the images using connect-form and express as in https://github.com/visionmedia/express/blob/cbdd907393e6fc9cf4eb092237241d1626a9a98d/examples/multipart/app.js . The images
Im uploading a file using the following jquery.. function ajaxFileUpload(jobid) { $(#loading) .ajaxStart(function ()
I am handling a uploading image file using PHP, then using ImageMagick to create
I'm uploading images using Spring and Hibernate. I'm saving images on the server as
am I uploading this file right? Here is my code: Deleted Code it is
I am uploading video on twitvid using its official php library. http://www.martin-gardner.co.uk/twitvid/twitvid.class.example.php#embedvideo But when
While uploading photo using Graph API, The caption of the photo should not be
After uploading a file from the UI, how to create the a new directory
I am currently uploading images pasted from the clipboard with the following code: //
uploading photos to a wall, i can use the items below, I am using

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.