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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:29:33+00:00 2026-05-23T09:29:33+00:00

I have a form that has 3 inputs: [1] text input field for a

  • 0

I have a form that has 3 inputs:

[1] text input field for a status update

[2] file upload (for a picture)

[3] text input field for attaching a link

The user toggles between each one depending on what they want to do. For example when choosing [2], inputs [1] and [3] are hidden.

All of these inputs are contained within a single form with id posts_form. Options [1] and [3] post via Ajax to different controllers.

My problem now is with option [2] because it is not possible to upload images using jQuery ajax.

Some solutions I’ve seen involve using the jQuery Form plugin, but I wonder if it would be possible to do image uploading without the use of a plugin.

For example this would be the code base for uploading which of course doesn’t work.

    $.ajax({
        url: 'chat/upload/' + <?php echo $page_id; ?>,
        type: 'POST',
        data: $('#posts_form').serialize(),
        dataType: 'html',
        beforeSend: function(){
              $('#loading').show();
            },          
        success: function(html) {
            $('#attach').replaceWith(html);
            $('#loading').hide();
            $('#posts_form input').val('');
            $('.posts_link').val('');
            $('#chat_input').hide();
            }
        });

Any suggestions on what could be added / changed to permit image upload using jQuery only, without plugins?

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-05-23T09:29:33+00:00Added an answer on May 23, 2026 at 9:29 am

    Your best choice is this plugin. You’re wasting your time trying to do it without this.

    http://jquery.malsup.com/form/

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

Sidebar

Related Questions

I have simple aspx page that has a form and a input field in
I have a form that has fields with the following name <input type=text name=value[]>
I have a form in CakePHP that has two live-search text input. Each one
I have a login form that has Username and password as inputs from user
I have a rails form that has a datetime input. I'd like to make
I have a search program that has multiple input text boxes that correspond to
I have a form that has a required input, but jQuery is saying that
So I have a script that makes dynamic form content and each input has
So I have a script that makes dynamic form content and each input has
I have a button that when clicked inserts a form input field and a

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.