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();">