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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:31:50+00:00 2026-05-25T06:31:50+00:00

I have this little form that has a button loading a little icon onto

  • 0

I have this little form that has a button loading a little icon onto the form itself.
The button says ‘browse’, and there is another button says ‘upload image’.
I find it kinda unnecessary to have two buttons to upload the image.

How can I make the upload happen on the end of Browse ?

here’s the code by the way.
(The upload button just activate the js that calls a php file that does the trick, the js function updates it on the form)

<form class="jQ-form" action="includes/ajaxupload.php" method="post" name="standard_use" id="standard_use" enctype="multipart/form-data">
    <fieldset>  
        <button id="image_upload_button" style="float:left;"  onclick= "$('#upload_area').css('display','none');
        $('#upload_area').fadeIn('slow');ajaxUpload(this.form,'includes/ajaxupload.php?filename=filename&amp;maxSize=200000&amp
        ... more func data.'); return false;" disabled>upload icon</button>

        <input type="file" id="upload_file" name="filename" style="float:left;width:70%;" size="42"/>

        <p style="float:right;color:#a2983c;margin:10px;width:373px;">
        Pick a nice icon that is max 300x300 pixels please
        </p>

        <?php 
            echo '<div id="upload_area" style="'.((($theiconname!='') && (file_exists($thumb_path.$theiconname))) ? '' : 'display:none;').'float:left;
            width:50px;height:50px;border:3px solid #000;margin-top:12px;margin-left:3px;">';
            if ($theiconname){

                if (file_exists($thumb_path.$theiconname))
                {
                    echo'<img id="the_logo" src="'.$thumb_path.$theiconname.'"/>';
                }

            }
        ?>
        </div>
    </fieldset>
</form>

Thanks in advance!

  • 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-25T06:31:51+00:00Added an answer on May 25, 2026 at 6:31 am

    Sure! Just detect when the file input field has been changed, then submit the parent form. I notice you’re using jQuery so I’ll provide an answer using that:

    $("#upload_file").change( function(){
         $("#standard_use").submit();
    });
    

    Alternatively, if you’re submitting this via AJAX and not actually intending to submit the form, then replace $("#standard_use").submit(); with whatever function would normally fire when someone pressed your “upload image” button.

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

Sidebar

Related Questions

I have this little script to toggle a contact form when a button is
I have this easy little form in my JavaFX application. I want to use
I have this little problem, that I cannot figure out which arguments to pass
I have this little question that's been on my mind for a while now.
I have this nice little MSBuild-based daily build setup that I use on my
I have a form that I have sized to what I wanted, it has
So I have a form that has 4 inputs, 2 text, 2 hidden. I've
I have a friend that has a little bit of a holiday coming up
I have a form that has hidden elements in it to create a pseudo-array
I have an app that has a rather large help section in PDF form.

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.