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 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 4

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

        }
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 318
1 Richard Deeming 180
2 Sergey Alexandrovich Kryukov 175
3 Yogesh Kumar Tyagi 165
4 ChauhanAjay 156
0 Sergey Alexandrovich Kryukov 6,218
1 OriginalGriff 5,413
2 CPallini 2,473
3 Richard MacCutchan 1,627
4 Abhinav S 1,530


Advertise | Privacy | Mobile
Web02 | 2.8.140814.1 | Last Updated 11 Feb 2013
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