Go Premium for a chance to win a PS4. Enter to Win

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
?
679 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
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

772 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