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

  • Home
  • SEARCH
  • 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 6383247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:37:32+00:00 2026-05-25T02:37:32+00:00

I have a function that starts on the submission of a form #uploadform which

  • 0

I have a function that starts on the submission of a form #uploadform which is enctype="multipart/form-data". The issue is that when this form is submitted, I run another function that sends a post request to a document and receives information. I would like this information to submit with the initial form #uploadform but it seems that this post call happens after the form submission so the values do not get added. #progress_key is added to the form successfully because it happens before the post call. Anyone have any ideas around this?

$('#uploadform').submit(function(){

beginUpload();

}


function beginUpload() {
$('#progress_key').val(rand_id);

$.ajax({
type: "POST",
url: "progressbar/initial.php",
data: 'data,
dataType: 'json',
success: function(response, statusText) {

if(response.error == '') {  

vid_id=response.vid_id;
file_name=response.file_name;

$('#file_name').val(vid_id);
$('#vid_id').val(file_name);
}
}
});
}
  • 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-25T02:37:33+00:00Added an answer on May 25, 2026 at 2:37 am

    To do this, and avoid making a sychronous ajax request you can return false from your submit handler like this:

    $('#uploadform').submit(function(){
        beginUpload();
        $(this).unbind('submit');
        return false;
    }
    

    Then submit it at the end of the success function of your ajax call like this:

    $('#uploadform').submit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function that starts like this: jQuery(function($) { $('#map').bind('mousewheel', function(e, delta) {
I have a javascript function that looks like this: function getAlerts() { $.post('getAlerts.php', function(data)
I have an .m file that starts like this: function [] = foo(n); if
I have an application in vb.net that starts with a sub function do some
I have a bash script that has this function in it: function start_vi() {
I have this function that is storing the contents of an array in three
i have a QMainWindow that starts a QThread and waits for data from the
The issue is that at form submission through ajax the page still reloads, even
I have a client that connects to server, starts sending binary data and when
I have a nested ul menu structure that starts off like this: <div id=left>

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.