no one can login to my website with mozilla
-
- Guest
no one can login to my website with mozilla
Hi,
when I use java script to protect my website text and images from being copied the fields for username and password in Mozilla become unwritable and no one can login. The other browsers are working without problems. Do you have any idea how to solve the problem?
Here is the script. I am not using it now on the website because of the login problems, but it is a joomla site. I hope this information helps.
Thanks in advance!
<script>
//Disable select-text script (IE4+, NS6+)
function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
when I use java script to protect my website text and images from being copied the fields for username and password in Mozilla become unwritable and no one can login. The other browsers are working without problems. Do you have any idea how to solve the problem?
Here is the script. I am not using it now on the website because of the login problems, but it is a joomla site. I hope this information helps.
Thanks in advance!
<script>
//Disable select-text script (IE4+, NS6+)
function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
- SK.
- Moderator
- Posts: 20814
- Joined: October 18th, 2007, 1:28 pm
- Location: Third Rock From The Sun
- Contact:
- SK.
- Moderator
- Posts: 20814
- Joined: October 18th, 2007, 1:28 pm
- Location: Third Rock From The Sun
- Contact:
- jscher2000
- Posts: 11763
- Joined: December 19th, 2004, 12:26 am
- Location: Silicon Valley, CA USA
- Contact:
To exclude form fields from your script, try this:
Note that IE uses windows.event.srcElement rather than e.target, but it appears you are not targeting IE with this method so I've ignored that for present purposes.
Code: Select all
function disableselect(e){
if (e.target.tagName != "INPUT") return false;
}
Note that IE uses windows.event.srcElement rather than e.target, but it appears you are not targeting IE with this method so I've ignored that for present purposes.
- np
- Posts: 301
- Joined: October 18th, 2007, 6:31 pm
- Location: Winnipeg
- Contact:
Just add a print stylesheet of
Code: Select all
body { display: none;}
-
- Posts: 8
- Joined: November 12th, 2007, 1:51 pm
np wrote:Just add a print stylesheet ofCode: Select all
body { display: none;}
May be I can't do something right, but looks like it does not work. Any ideas how to add also ctrl+a and ctrl+c copying?
-
- Posts: 8779
- Joined: May 7th, 2007, 12:07 pm
- jscher2000
- Posts: 11763
- Joined: December 19th, 2004, 12:26 am
- Location: Silicon Valley, CA USA
- Contact:
usmivkata wrote:np wrote:Just add a print stylesheet ofCode: Select all
body { display: none;}
May be I can't do something right, but looks like it does not work.
The suggestion is to create a new .css file (e.g., print.css) and add a new <link> tag to your document specifying that the browser should use print.css for media="print". For more information:
http://www.tufts.edu/webcentral/tutorials/printcss/
http://meyerweb.com/eric/articles/webrev/200001.html
usmivkata wrote:Any ideas how to add also ctrl+a and ctrl+c copying?
Not sure exactly what this means. You want to intercept these keystrokes and discard them? You can look at the script for this photo slide show for an example of how to capture key events for Firefox and IE:
http://jeffersonscher.com/thailand2005/food/
http://jeffersonscher.com/thailand2005/food/photoview.js
You would need to add detection for the Ctrl key. This article should help:
http://developer.mozilla.org/en/docs/DOM:event.ctrlKey
Last edited by jscher2000 on February 21st, 2010, 8:25 pm, edited 1 time in total.
-
- Posts: 8
- Joined: November 12th, 2007, 1:51 pm
desable ctrl+a and ctrl+c on website
Sorry I could not explain it better. Actually I wanted to disable cthrl+a and ctrl+c functions in order to protect text and images from being copied.
In joomla based websites I do not think it is possible to add additional css file, so I have to add java script directly into the code.
In joomla based websites I do not think it is possible to add additional css file, so I have to add java script directly into the code.