Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have a asp File Upload control and a asp Button.
i want enable the asp Button only when the file upload control has any file or value in it.
Any suggestion.
Posted

Just use jquery to check the value:
JavaScript
$(document).ready(function () {
   $('#<%= YourFileUploadControl.ClientID %>').change( function(){
      if ( $('#<%= YourFileUploadControl.ClientID %>').val() <> '' ){
         $('#<%= YourButtonControl.ClientID %>').removeAttr('disabled');
      }
      else {
         $('#<%= YourButtonControl.ClientID %>').attr('disabled', 'disabled');
      }
    });
});
 
Share this answer
 
Try this....

if(document.getElementById("uploadid").value !="")
{
form.buttonnid.disabled=false;
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900