Disable A Link So Users Can't Click On It?
Mar 11, 2011How do i disable a link so users can't click on it?
View 1 RepliesHow do i disable a link so users can't click on it?
View 1 RepliesIm trying to prevent the user from clicking any other links on my page when
the user have selected/clicked a href once.
Sometimes it takes a while before the next page loads so some user will try
clicking other links or the same link.
I can prevent this when i use buttons by calling onclick and in a javascript
getElementsByTagName("input") and then check the type to be type of "button"
or "submit" which i then disable. It works.
This also works for href html tags by calling onclick and in a javascript
remove all href, BUT it also stops everything, even the request that is
about to happen.
If i use disable getElementsByTagName("a") on href like with buttons it does
not get unclickable just get a grey color but you can click on it.
Any workaround to this? This is a seriuos web app so I want the solution
where i disable ALL links on my page so it is not possible to click on any
after the first time.
All the links is NOT in a form only links using <a href="gosomeplace"> click
this link</a> .
I'm moving from fully Flash sites to AJAX withjQuery etc. I see that handling the situation where the user has javascript disabled is given a lot of emphasis in books and tutorials on jQuery. Is it really that important? After all, if you've disabled javascript shouldn't you accept a limited result? Accessibility seems a valid reason, but how many screen readers can't handle javascript? Mobile and other devices that can't handle it are only a concern if your site is one that's likely to be of interest to a small set of users so do you need to worry about them?
View 1 Replies View Relatedhow to disable users from downloading the page?? (clicking 'save page as'.. and then error)
View 4 Replies View RelatedI am having a problem with my wysiwyg editor for my site, users dont like the fact that you have to select text before you create a link and I was wondering if it was possible to prompt the user to add title text before you use the execCommand('createlink') and use that has the select text that they made from the prompt. Instead of the old way where you must select text first to use execCommand('createlink') to create a link. kind of like Sitepoint's insert link function but instead prompts the user for the title and doesn't insert bbcode but a anchor tag?
View 7 Replies View RelatedI'm trying to figure out a way to add a simple tool to allow users to click an input box (or a nearby button if using the input box is not possible) and a small box will pop up displaying a bunch of images. When one of the images is clicked, I need a specific URL related to that image to be added to an input box. I've put together a demo page showing where I'm trying to use this: [URL].
As you can see in the demo, at the bottom of the page is an editing box, in that box is a small label of "Bkgrnd image" and there is an input box below that with a URL for an image in it. I want users to be able to either click the input box (or a nearby button if necessary) and a list of images to pop up for them to select from. When they click the image, a URL will replace the original one in the input box.
Should I disable the right click option or not? I have a gallery site, I don't want people to be able to copy the images with the default right click over an image. From a professional looking site point of view I suppose I would be messing with the functionality a bit too much, OR is it OK in this instance to disable the click. I know how to write the code to disable the click, but what I was thinking was maybe it would be better to leave the right click but change the menu options? I'm not sure how to change the menu options ere is a link to the site. [URL]
View 12 Replies View RelatedI want to call the click event of the link (anchor tag) on the click of the button. I used this code below in the click event of button to call links click event and it works fine in IE.
document.getElementById('linktag').click();
But, this doesn't work in Firefox. I googled a bit and found that in firefox, you have to do something more to achieve this behaviour. So, I ended up doing this on button click to work in firefox:
var link=document.getElementById('linktag');
var e = document.createEvent('MouseEvents');
e.initEvent(
[code]....
The above code does the click on link when I click on the button. But my problem now is that I have defined a link as
<a href="mailto:abc@xyz.com?subject=abc&body=email body">email </a>
and when click is called and mailto links opens my email client, it somehow ignores the subject and body parameters of the link. It works properly when i actually click a link element. but it doesn't work when i simulate the click event by code written above. above dispatching event code somehow ignores the link parameters?
Below is an example of a synthetic click in Firefox. The browser does
not follow the link. Is that the just the way synthetic clicks work of
am I doing something wrong? I know the synthetic click occurs because
if I add an onclick attribute to the link the handler runs. Any ideas? Code:
How can I give a click on a link when it is just created and added to DOM?
None of this works:
function openProfilePage(profile){
$('#profile-link').remove();
var link = $('<a/>').attr({'href':'profile.php?user='+profile, 'target':'_blank', 'id':'profile-link'}).css({'top':'-200px','left':'-300px', 'position':'absolute'}).html(profile);
[Code]...
I have website, I put money change conversion from www.indoexchange.com use JavaScript (please check my website www.servomedia.net). But, unfortunely, they have links but the links are invalid (not any in my site).
How exactly to disable that links using JS? Long time ago I ever see the way but I forget where I found it.
I have a page that submits to a db then re-loads its self with new information. Unfortunately it goes wrong when the user double clicks on a one of many text links that provides the info for the display on reload. How do I stop users from double clicking on the page? Ideally I think I would like to call some sort of js function from body onload as I presume this would then cover the whole of the page, but have no idea if this is possible or how to go about writing it.
View 8 Replies View Relatedhow can i disable the main link on my navigation. i have manage to use onclick=javascript:return false; on the sub link but on the main link i'am lost.
this is my code for my navigation
Code:
<ul class='menu' id='menu' name='menu'>
<li><a href='createticket.php' target='body'>Create Ticket</a></li>
//main link with sublink
[Code]....
I am making a page that uses JS to bring up a "popup <div>" when the user clicks on a particular link. I am concerned that if the users browser has JS turned off, nothing will happen when they click. I thought the way around this would be to have a valid href in the link so that if the JS doesn't work, the browser will be directed to an alternative page.
Can I include something in my JS function so that when the user clicks the link, the JS will run and disable the href link at the same time? My thinking is, if JS is disable in the browser, this function would not work, so the browser would continue to load the href link.
What's the best way to display an image, disabling the user's ability to right-click on it?
I believe you have to use <body oncontextmenu="return false">. Would the
following work?
var x = "<head></head><body oncontextmenu="return false"><img src='temp.jpg' border=0></body>"
top.document.open()
top.document.write(x)
top.document.close()
Since this is a frameless site, I don't think this would work, at least
would never get to the close()...
I need to be able to disable a link upon clicking an agreement. Here is what I currently have, I am trying to make a custom button for jcryption.[code]...
View 2 Replies View Relatedi've searched this forum before posting but didn't find a "clean" solution to my problem.
I have an image with a link on it:
Code:
<a href="#null" onClick="addValue('bold');"><img src="images/myimage.gif" title="Some text" alt="Some text" /></a>
which adds the value in a textarea in the same page via this function:
Code:
function addValue( val ) {
var tb = document.forms['valuesform'].elements['valuesfield'];
if ( tb.value.length > 0 ) tb.value += " , ";
tb.value += val;
}
I need to disable the link after the image has been clicked,preventing multiple insertions of the same value. I've modified the link this way:
Code:
<a href="#null" onClick="addValue('bold'); this.onclick=null;" ><img ......
but while only one click is allowed,i get many JS errors in the JSConsole like
Code:
uncaught exception etc.... and i think this is not a good sign.=
What is the command to prevent "right clicking".
View 12 Replies View RelatedThis has probably been covered before but I can't seem to find it. I
want to disable the user from using the right mouse button that brings
up a windown menu of options. How's it done?????
i am using the following code to open a popup window in this code can i disable right click on the popup
string url = "example";
Response.Write("<script language='javascript'>window.open('" + url + "', '_blank', 'height=500,width=350,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no,align=center' );</script>");
I've already tried searching google, but the Javascript functions I find there don't work in Firefox 4, but just fine in IE8.
What's happening is that the click event isn't being recognized in Firefox. Is there a new catch for it?
The latest attempt:
<script LANGUAGE="Javascript1.1">
<!-- Original: Martin Webb (martin@irt.org) -->
<!-- This script and many more are available free online at -->
<!-- The Javascript Source!! http:javascript.internet.com -->
[Code].....
how can I make this script, have the right click menu be disabled for all other browsers - Firefox, Opera, etc?
Code JavaScript:
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Sorry, these images are copyright protected.");
[Code]...
There is a page which includes an iframe. I know how to disable right click in that page, but users can use right click in the iframe. Is it possible to disable right click in the iframe as well, without editing the page displayed in the iframe?
View 24 Replies View Relatedi want to disable right click on this script its very urgent
[Code]...
in my web application i've disabled all F keys with common script like this below, i use F keys for open some different popups, but only F12 key have problem, if i press F12 first time it run well and open my popup, but if i close it and i immediatly press F12 again it doesn't open my popup but it open developer tool window.It run well only if before i click with mouse onto the page, but i do not have to use the mouse.
View 5 Replies View RelatedAssume there's a form with it's action attribute all set to post to a
URL, but without a submit control. Form submission is done via a link
and I want to prevent the classic "double submit". Ignoring the server
side of things, does anyone see any holes with the following script? It
seems to work, but I'd appreciate other eyes on it. Maybe a
try/catch/finally wrapper of some sort to be sure the link is
re-enabled in the face of an exception. I understand there are (many)
other ways to do this (e.g. temporarily "remove" the link), but I'm
mostly curious about the this.onclick=falseFn/this.onclick=arguments.callee combo and any potential gotchas....