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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:16:49+00:00 2026-06-04T21:16:49+00:00

I am running into one issue. I have a form which submits an article

  • 0

I am running into one issue. I have a form which submits an article via $.ajax() the problem is that I am giving user option to upload file and I do not want the page to refresh, so I placed upload form inside the main form which submits article. It does seem I can’t nest forms.. and I also need the value of file in $_FILES array ..

Here is my HTML form:

<form action="/" id="upload-form">
    <fieldset>
        <p class="upload-result">
        <!-- result of upload goes here -->
        </p>
        <p class="upload-images">
            <label><?php _e('Upload Images','sofa'); ?></label><a href="" class="button-secondary img_add_upload"><?php _e('Upload Image','sofa'); ?></a><a href="" class="button-secondary img_add_url"><?php _e('Add Image URL','sofa'); ?></a>
        </p>
        <p class="upload-url">
            <input type="text" name="img_url" id="img_url" value="<?php _e('Enter URL of image here...','sofa'); ?>" /><a href="" class="button-secondary img_add"><?php _e('Add Image','sofa'); ?></a>
        </p>
        <p class="upload-file">
            <input type="file" id="async-upload" name="async-upload" size="47" /><a href="" class="button-secondary img_upload"><?php _e('Upload','sofa'); ?></a>
        </p>
        <ol class="upload-images-lib">
            <li></li>
        </ol><div class="clear"></div>
        <p class="upload-images-note"><?php printf(__('Click on image to view full size. To mark image as main/featured, add image then click on %s icon.','sofa'), '<img src="'.get_bloginfo('template_directory').'/img/box.png" alt="" />'); ?></p>
        <p class="upload-input">
            <label for="utitle"><?php _e('Title','sofa'); ?></label>
            <input type="text" name="utitle" id="utitle" value="" />
            <span><?php _e('Enter a good title that describes what you are publishing. Be creative!','sofa'); ?></span>
        </p>
        <p class="upload-input">
            <label for="cat"><?Php _e('Category','sofa'); ?></label>
            <?php wp_dropdown_categories('hide_empty=0'); ?>
        </p>
        <p class="upload-editor">
            <?php wp_editor( '', 'ucontent', $settings = array(
                'textarea_rows' => 8,
                'textarea_name' => 'ucontent'
            )); ?>
        </p>
        <p class="upload-input">
            <label for="utags"><?php _e('Tags','sofa'); ?></label>
            <input type="text" name="utags" id="utags" value="" />
            <span><?php _e('Enter a comme seperated list of tags that perfectly describe your post. e.g. funny, man, public','sofa'); ?></span>
        </p>
        <p class="upload-submit">
            <input type="submit" value="<?php _e('Publish','sofa'); ?>" class="gradient-link-normal" />
        </p>
    </fieldset>
</form>

The problem is with this part.

<p class="upload-file">
    <input type="file" id="async-upload" name="async-upload" size="47" /><a href="" class="button-secondary img_upload"><?php _e('Upload','sofa'); ?></a>
</p>

I want to process the file upload, when this is clicked and the PHP form, which does the file upload requires $_FILES array obviously.

I am not sure if this is possible. Any solution?

  • 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-04T21:16:50+00:00Added an answer on June 4, 2026 at 9:16 pm

    You need to use a jQuery plug-in to deal with the file upload, and deal with the remaining data from your from as you already do.

    There are some ready-made plug-ins to perform the file upload:

    valums ajax upload

    jQuery Multiple File Upload Plugin

    AjaxFileUpload

    jQuery File Upload

    You can find more at the jQuery’s plug-ins site.

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

Sidebar

Related Questions

I am running into a strange issue. I have a dropdown list that contains
The issue I'm running into is I have an NSMutableArray labeled: _podAllEntries, which contains
I'm working on creating a self updating application and one issue I'm running into
I am running into an issue similar to the one described here: NSFetchedResultsControllerDelegate not
Running into a problem. I have a table defined to hold the values of
I'm running into a very annoying issue. One of our SPROC is building up
Alright, so I'm running into an issue with my code. What I have done
Hey guys I'm running into a weird issue.. Basically, a user logs into a
I have a ASP.NET C# business webapp that is used internally. One issue we
Trying to set up one-way SSL with Weblogic 11g and running into an issue.

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.