The upload button becomes invalid after the judgment statement is added.
Script var send = document. getElementById ("send"); send. onclick = function () {var file = document. getElementById ("img "). value; var file = document. getElementById ("img2 "). value; if (file. length <1) {alert ('select image'); return false ;}} script
Reply to discussion (solution)
Script
Var send = document. getElementById ("send ");
Send. onclick = function (){
Var file = document. getElementById ("img"). value;
Var file = document. getElementById ("img2"). value;
If (file. length <1 ){
Alert ('select the image ');
Return false;
}
}
Script
After this operation, it becomes invalid. What is going on.
Script
Var send = document. getElementById ("send ");
Send. onclick = function (){
Var file = document. getElementById ("img"). value;
Var file = document. getElementById ("img2"). value;
If (file. length <1 ){
Alert ('select the image ');
Return false;
}
Return true;
}
Script
Script
Var send = document. getElementById ("send ");
Send. onclick = function (){
Var file = document. getElementById ("img"). value;
Var file = document. getElementById ("img2"). value;
If (file. length <1 ){
Alert ('select the image ');
Return false;
}
Return true;
}
Script
No.
What does expiration mean? Is it not allowed to submit?
Correct the problem first.
What does expiration mean? Is it not allowed to submit?
Yes, it cannot be submitted. But now we have done it. Thank you!