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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:39:37+00:00 2026-06-17T04:39:37+00:00

I want the start_uploading function only to start if all the conditions are met

  • 0

I want the start_uploading function only to start if all the conditions are met and the file is uploading, right now the ‘loading’ message pops up for a split second when the form is submitted but it did not meet all the conditions to upload.

if(condtion){// don't start function} else

if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
  //now start function} else echo "error";

javascript

function start_Uploading(){
  document.getElementById('message').innerHTML = 'Loading... <br> Please Wait';
  return true;
}

and html

<form action="something.php" method="POST" enctype="multipart/form-data"
 onsubmit="start_Uploading();">    
  • 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-17T04:39:37+00:00Added an answer on June 17, 2026 at 4:39 am

    Since you are checking for the condition to be true in php, I would simply only echo out the js method name if the condition is met.

    Like so:

    <?php
      if(true) $onsubmit = "start_Uploading();"; // Put actual condition in parantheses
      else $onsubmit = "";
    ?>
    

    And then in your form:

    <form action="something.php" method="POST" enctype="multipart/form-data"
    onsubmit="<?php echo $onsubmit; ?>">
    

    If the condition isn’t met, no method name will be provided and js simply won’t know what to look for on submit.

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

Sidebar

Related Questions

I want to a message when ajaxToolkit:AjaxFileUpload start uploading, is there a way to
I have a situation like this: start(); <Some code> end(); I want start() function
I want to start a new thread using a C function, not an objective-C
I want to view data stored in an uploading session but all I get
I want to write a jQuery file uploading program, using this plug-in http://aquantum-demo.appspot.com/file-upload Despite
I am trying to implement a multiple file upload where I am right now
I am uploading a file on server using this code, But I want such
I want to start several threads, retrive data from net, perform some actions with
I want to start a phar script as an executable, directly by doing foo.phar
I want to start manage application ( Settings -> Application -> manage application ->

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.