Click here to Skip to main content
15,894,955 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
plz help me out..

how to disable and enable buttons through javascript
my problem is disabled buttons are not getting enabled through javascript but enabled buttons are disabled through javascript
Posted
Updated 5-May-16 22:58pm
v2
Comments
koolprasad2003 26-Aug-11 1:35am    
can show use code ?

You can find/search any element using javascript like this and set their attribute.

JavaScript
document.getElementById('button').disabled = true; 

Hope this will help.
 
Share this answer
 
Comments
hitech_s 26-Aug-11 1:32am    
disabled buttons are not getting enabled this is the probolem
Suresh Suthar 26-Aug-11 1:35am    
Have tried disabled= false.
Sergey Alexandrovich Kryukov 26-Aug-11 1:41am    
Correct; should work; my 5.
--SA
there is no .enable property exist in javascript for any control.

you have to use following code

document.getElementById("buttonID").disabled = true
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Aug-11 1:41am    
= true. or false. My 5.
--SA
koolprasad2003 26-Aug-11 1:47am    
Thanks SA

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