The upload button becomes invalid after the judgment statement is added.

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.