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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:19:23+00:00 2026-06-01T10:19:23+00:00

Would anyone be able to tell me what I’m doing wrong in the following

  • 0

Would anyone be able to tell me what I’m doing wrong in the following code that the form is not being submit to the iframe?

$(function() {
    $(".preview").click(function() {
        $('#sliderimage').wrap('<form action="/index/upload.php" method="post" id="imageform" target="imageupload" />');
        $('#imageform').submit();
        $('#sliderimage').unwrap();
        return false;
    });
});​


<iframe style="display: none;" name="imageupload" id="imageupload"></iframe>
<input type="file" id="sliderimage" name="sliderimage">
<input type="button" class="preview" value="Preview">
  • 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-01T10:19:24+00:00Added an answer on June 1, 2026 at 10:19 am

    There are two problems I see right away, not sure if they will solve the issue or not.

    You have set the ‘type’ to post. this attribute should be method.

    as well you need to set the enctype on the form.

    $(function() {
        $(".preview").click(function() {
            $('#sliderimage').wrap('<form action="/index/upload.php" method="post" id="imageform" target="imageupload" enctype="multipart/form-data" />');
            $('#imageform').submit();
            $('#sliderimage').unwrap();
            return false;
        });
    });​
    

    EDIT

    The code above is a direct cut and paste from your source…. this means the ‘hidden'(​) character jsfiddle pastes into your javascript is also there. remove it and you js will function. to do this simply backspace at the end of your js code once.

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

Sidebar

Related Questions

Would anyone be able to tell me why my following code doesn't centre the
Would anyone be able to tell me the Greasemonkey code to make this page
Would anyone be able to tell me how to pull the server name out
Would anyone please be able to tell me the most efficient way to compare
Am failry new to authentication logic, would anyone be able to tell me if
I was tasked with developing an application that would be able to tell someone
Would anyone be able to help me with how to get the file properties
So my quick question to everyone is, would anyone be able to explain to
I was wondering if anyone would be able to help me convert the below
Would anyone offer tips, links, code snippets on how to browse to a file

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.