Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
How to make button unclickable (visible but no click) untill you write something in textbox???
Posted
Comments
José Amílcar Casimiro 11-Feb-13 8:07am    
button1.Enabled = false;
harshadcse 11-Feb-13 8:31am    
thanx.. buddy...
harshadcse 21-Feb-13 2:58am    
thanx

Use Enabled[^] property.
 
Share this answer
 
Comments
Joezer BH 11-Feb-13 9:17am    
5+
Maciej Los 11-Feb-13 9:20am    
Thank you ;)
LinkButton1.Enabled = false;
 
Share this answer
 
Comments
Joezer BH 11-Feb-13 9:18am    
5+
Avik Ghosh22 11-Feb-13 11:02am    
thanks bro...
You can do this in JS, see example code:
It goes over the input fields and checks if they have values in order to enable the submit button
JavaScript
<input type="submit" id="register" value="Register" disabled="disabled" />

...

(function() {
    $('form > input').keyup(function() {

        var empty = false;
        $('form > input').each(function() {
            if ($(this).val() == '') {
                empty = true;
            }
        });

        if (empty) {
            $('#register').attr('disabled', 'disabled'); 
        } else {
            $('#register').removeAttr('disabled'); 
        }
    });
})()


Cheers,
Edo
 
Share this answer
 
You can use java script
JavaScript
function TextChange() {
    var button = document.getElementById("Button1");
    button.disabled = true;



}
 
Share this answer
 
v2
You can do this like

Button1.Enabled = false;
 
Share this answer
 
Comments
harshadcse 16-Feb-13 3:02am    
got it/... :P
But disable option too disable button colours, how to unclickable button with out hiding its colour. there are any ways!!!???
 
Share this answer
 

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