Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
How to make button unclickable (visible but no click) untill you write something in textbox???
Posted 11-Feb-13 1:59am
Comments
   
button1.Enabled = false;
harshadptl4 at 11-Feb-13 8:31am
   
thanx.. buddy...
harshadptl4 at 21-Feb-13 2:58am
   
thanx
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use Enabled[^] property.
  Permalink  
Comments
Edo Tzumer at 11-Feb-13 9:17am
   
5+
Maciej Los at 11-Feb-13 9:20am
   
Thank you ;)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

LinkButton1.Enabled = false;
  Permalink  
Comments
Edo Tzumer at 11-Feb-13 9:18am
   
5+
Avik Ghosh22 at 11-Feb-13 11:02am
   
thanks bro...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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
<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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

You can use java script
        function TextChange() {
            var button = document.getElementById("Button1");          
            button.disabled = true; 
          
 

        }
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

You can do this like
 
Button1.Enabled = false;
  Permalink  
Comments
harshadptl4 at 16-Feb-13 3:02am
   
got it/... :P
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 7

But disable option too disable button colours, how to unclickable button with out hiding its colour. there are any ways!!!???
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 616
1 OriginalGriff 351
2 Maciej Los 210
3 Mehdi Gholam 145
4 PIEBALDconsult 140
0 Sergey Alexandrovich Kryukov 11,384
1 OriginalGriff 5,783
2 Maciej Los 5,684
3 CPallini 3,879
4 BillWoodruff 3,584


Advertise | Privacy | Mobile
Web01 | 2.8.141030.1 | Last Updated 23 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100