Button Id Problem
-
My application is in Asp.net 2.0. In my applicaton, There is one Repeater contorl. in Repeater there is a button. I have to disable that button with javascript. can any one help me. how can i find bytton id in javascript. thanks
-
My application is in Asp.net 2.0. In my applicaton, There is one Repeater contorl. in Repeater there is a button. I have to disable that button with javascript. can any one help me. how can i find bytton id in javascript. thanks
When you want to disable?Or In which event? You need to pass the button id MyButton.ClientID to the JS Function.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
When you want to disable?Or In which event? You need to pass the button id MyButton.ClientID to the JS Function.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
Thanks for replying me. I want to disable it on form button click event. thanks
-
Thanks for replying me. I want to disable it on form button click event. thanks
In page load add button1.Attributes.Add("onclick","javascript:DisButton('" & button2.ClientID & "')") JS Function function DisButton(cntrl) { document.getElementById(cntrl).disabled=true; return false; } on button1 click button2 will disable.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
In page load add button1.Attributes.Add("onclick","javascript:DisButton('" & button2.ClientID & "')") JS Function function DisButton(cntrl) { document.getElementById(cntrl).disabled=true; return false; } on button1 click button2 will disable.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
thanks for Reply. but i have to access control id from javascript. like we access another control value. also button on which i have to access javascript is outside the repeater. and i required control id which is in repeater. can u help me in this regards thanks
-
thanks for Reply. but i have to access control id from javascript. like we access another control value. also button on which i have to access javascript is outside the repeater. and i required control id which is in repeater. can u help me in this regards thanks
I'm not sure what you are trying to do. You have repeater and that contains a button atleast. say button1 You have an another button thats outside the repeater. say button2 So on button2 click you want to disable the button1. If this is the requirement.... 1.You can use the FindControl function of repeater to get controls inside therepeater, and pass the ID of button1 to the JS function. 2.You can store the ID inside a hidden field and get it in the JS. Hop this Helps you...
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.