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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:47:02+00:00 2026-06-13T05:47:02+00:00

I have the following html form. Here the image upload is working fine. But

  • 0

I have the following html form. Here the image upload is working fine. But i want to make the image upload in ajax so that before submitting the form with other details. The preview of the image can be shown in side.

<form action="<?=base_url();?>index.php/insert/insertdata" method="post" enctype="multipart/form-data">

        <tr><td><b>Title: </b></td><td><input type="text" name="title"/></td></tr>
        <tr><td><b>Url: </b></td><td><input type="text" name="url"/></td></tr>

        <tr><td><b>Image: </b></td><td><input type="file" name="image"></td></tr>

        <tr><td><b>Status: </b></td><td><select name="status"><option value="visible">Visible</option><option value="invisible">Invisible</option></select></td></tr>  

        <tr><td><input type="submit" value="submit"/></td><td><input type="reset" value="reset"/></td></tr>
    </form>

jquery is also welcome. But I would like to avoid using the form tag again.

  • 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-13T05:47:03+00:00Added an answer on June 13, 2026 at 5:47 am

    once your uploading a image then fetch the image name with url and add to the

    $.ajax(url,{data},function(res){
    
            //check status if it is 200 then assign the res to the img
           $('#img').attr('src',res);
    
    })
    

    //Html write this after the image file

     <img src="" id="img">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a following problem, I have HTML form that uploads a file with
I have a simple html form that looks like the following <form action=search.php method=get>
Here's my issue: I have a html form that after a user fills in
as you can see in the following image, i have a simple form that
I have the following html code: (that gets loaded via ajax into a div)
I have following Situation, Server A sends some data (HTML form) to server B,
I have the following html code: <form> <table> <tbody> <tr> <td> <span>Quantity<span class=pull-right>3</span> <input
I have the following multi-select box in a HTML form, where user can select
Suppose I have the following HTML: <form id=myform> <input type='checkbox' name='foo[]'/> Check 1<br/> <input
I have a form with the following HTML below: <form id=course_edit_form name=course_form action=/courses/save method=post>

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.