我希望 start_uploading 函数仅在满足所有条件并且文件正在上传时才启动,现在在提交表单时会弹出“正在加载”消息,但它不符合所有上传条件。
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;
}
和 html
<form action="something.php" method="POST" enctype="multipart/form-data"
onsubmit="start_Uploading();">