Click here to Skip to main content
12,395,173 members (66,162 online)
Rate this:
 
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 11-Feb-13 8:31am
   
thanx.. buddy...
harshadptl4 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 11-Feb-13 9:17am
   
5+
Maciej Los 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 11-Feb-13 9:18am
   
5+
Avik Ghosh22 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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 23 Aug 2014
Copyright © CodeProject, 1999-2016
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