Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Helloo,

I want to make disable the button after all my requirefield validator are false. I use the javascript function on that button OnclientClick event for the message.

now, when user click first time then after that button disable for the second time click and no further action will be done by the user.


So, how can I disable the button using the Javascript.
i use the below javascript but not work to make the button disable.
function validate()
    {
        if(Page_ClientValidate())
        {        
            if(!confirm('Are you Sure to submit your order to us?'))
            {              
                document.getElementById("btn_submit").enabled=false;
                return false;
                
            }
        }
   }



Thanks in advance...
MItesh
Posted

1 solution

Try this..
C#
function validate()
    {
        if(Page_ClientValidate())
        {
            if(!confirm('Are you Sure to submit your order to us?'))
            {
//                form1.Button1.disabled = true;  
                //document.getElementById("btn_submit").enabled=false;
                return false;
            }
         form1.Button1.disabled = true;  
        }
   }
 
Share this answer
 
v2
Comments
[no name] 19-Oct-12 1:00am    
its working Ashish Bhai

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