Enable/Disable LinkButton in Javascript
-
I want to disable a LinkButton click on the client site. if(true) objLinkButton.disabled = true; else objLinkButton.disabled = false; This disables the link but I am still able to click on the link and do PostBack. Is there any way I can disable/enable the link.
-
I want to disable a LinkButton click on the client site. if(true) objLinkButton.disabled = true; else objLinkButton.disabled = false; This disables the link but I am still able to click on the link and do PostBack. Is there any way I can disable/enable the link.
You also need to remove/add the href for the link depending on what you want to do.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
You also need to remove/add the href for the link depending on what you want to do.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
Yes I tried it like below, document.getElementById(lkbtn).removeAttribute("href"); This works fine. But when i am adding attribute it raises error. document.getElementById(lkbtnEditMap).addAttribute("href"); So i did like this document.getElementById(lkbtnEditMap).setAttribute("href"); enable/disable works fine but when click on link button it showing error like resource cannot be found....
-
Yes I tried it like below, document.getElementById(lkbtn).removeAttribute("href"); This works fine. But when i am adding attribute it raises error. document.getElementById(lkbtnEditMap).addAttribute("href"); So i did like this document.getElementById(lkbtnEditMap).setAttribute("href"); enable/disable works fine but when click on link button it showing error like resource cannot be found....
SatyaKeerthi15 wrote:
document.getElementById(lkbtnEditMap).setAttribute("href");
What are you setting the link to? You haven't actually specified the href value in there.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
SatyaKeerthi15 wrote:
document.getElementById(lkbtnEditMap).setAttribute("href");
What are you setting the link to? You haven't actually specified the href value in there.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
If Set href and click on link button again its loading page. Is it the good way to load page agian when click on linkbutton in same page.