Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

even i remove disabled hyperlink and hand icon still the process is goingon?how to restrict

Posted on 2007-11-30
3
Medium Priority
?
677 Views
Last Modified: 2012-05-05
<a href="#" onclick="return SubmitForm('emp-header','emp-header:Approve');" id="Approve" type="submit" style="color: #FFFFFF;" class="enabledTabText">XXXX</a>


Depending the empStatus i am trying to disable hyperlink and also remove hand icon.both are disbled and hand icon is removed.

but the problem  is even though i removed disable hyperlink and removed hand icon still when user clicks on the hyperlink and the process is going.

            if(document.getElementById("empStatus").value == "Y")
                  {
                        document.getElementById("Approve").style.cursor='default';
                        document.getElementById("Approve").disabled = true;
                  }
0
Comment
Question by:chaitu chaitu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 21

Expert Comment

by:nizsmo
ID: 20387263
Are you sure your condition is being met?

Try this and see if you get an alert box:

if(document.getElementById("empStatus").value == "Y")
                  {
                        alert("condition met");
                        document.getElementById("Approve").style.cursor='default';
                        document.getElementById("Approve").disabled = true;
                  }
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 20387268
i got an alert.you can try to replicate this scenario in ur system also.button is disabled and hand icon is removed but still i can click on that process going on to the server side.
0
 
LVL 36

Accepted Solution

by:
Zyloch earned 2000 total points
ID: 20387292
This is the behavior because disabled is not a standard property of hyperlinks. If you want to disable a hyperlink, you can do several things. One is to temporary remove the href property, something like

document.getElementById("Approve").removeAttribute("href");

Then, you will still need to remove the onclick. The other method is again change around the onclick, then you can add a disabled style to the hyperlink using Javascript and style disabled links a certain way (default cursor, certain color, etc.)

Both methods, you need to switch the onclick. To disable, for example, you will need

document.getElementById("Approve").onclick = function() { return false; }
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question