The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Disable Right Click on HTML page

View previous topic View next topic Go down

In progress Disable Right Click on HTML page

Post by SoSweet on January 21st 2013, 4:25 am

I want to disable right click on a HTML page. Not a pop-up disable, but a complete disable where right clicking does nothing.
Can anyone help me with a code for it please? Thanks Smile

On a note,
for my forum, I have it so that you get a popup for disable right click. By for my HTML page, I want to disable it completely. However, I'm using the "Use forum header" option, and since my popup disable right click script is a forum widget, that one shows up too. I just added this cause I thought that might be helpful info.

TY !

SoSweet
New Member

Female Posts : 15
Reputation : 1
Language : English

Back to top Go down

In progress Re: Disable Right Click on HTML page

Post by Sanket on January 21st 2013, 5:23 am

http://help.forumotion.com/t50779-script-to-disable-the-right-click
Please read the tutorial. There is a no pop-up version for forum as well as html pages.

Sanket
ForumGuru

Male Posts : 48766
Reputation : 2819
Language : English
Location : Mumbai

http://webartzforum.com

Back to top Go down

In progress Re: Disable Right Click on HTML page

Post by SoSweet on January 21st 2013, 6:11 pm

yea but where do i put in this part?

Code:

<BODY oncontextmenu="return false">
    </body>


I dont get this:

Add the attribute above ( oncontextmenu="return false" ) in the first body tag and it will silently disable right clicks from your mouse.

Example of this code on my forum ~ Click Here

I have no body tags....


edit: oh wait, i just add this:
Code:

<BODY oncontextmenu="return false">
    </body>


right? forget about the javascript thing??

SoSweet
New Member

Female Posts : 15
Reputation : 1
Language : English

Back to top Go down

In progress Re: Disable Right Click on HTML page

Post by Sanket on January 21st 2013, 6:50 pm

Add this code instead.

General>Forum>Configuration
Site Description: Add the code below.
Code:
<script language=Javascript1.2> function ejs_nodroit() {    return(false); } document.oncontextmenu = ejs_nodroit; </script>

Sanket
ForumGuru

Male Posts : 48766
Reputation : 2819
Language : English
Location : Mumbai

http://webartzforum.com

Back to top Go down

In progress Re: Disable Right Click on HTML page

Post by SoSweet on January 21st 2013, 7:03 pm

thanks, but I only want the script in one HTML page

that code will put it in all pages Sad

SoSweet
New Member

Female Posts : 15
Reputation : 1
Language : English

Back to top Go down

In progress Re: Disable Right Click on HTML page

Post by Akkii on January 21st 2013, 7:06 pm

Then add the code in your HTML.

Akkii
Forumember

Male Posts : 710
Reputation : 107
Language : English,HTML, CSS,Photoshop,Javascript!
Location : Here on Forumotion!

http://www.csshelp.net

Back to top Go down

In progress Re: Disable Right Click on HTML page

Post by Sanket on January 21st 2013, 7:10 pm

http://www.webartzforum.com/t85-start-learning-html
See the body tags when you make a html page.

Sanket
ForumGuru

Male Posts : 48766
Reputation : 2819
Language : English
Location : Mumbai

http://webartzforum.com

Back to top Go down

In progress Re: Disable Right Click on HTML page

Post by SoSweet on January 21st 2013, 7:21 pm

@Sanket wrote:Add this code instead.

General>Forum>Configuration
Site Description: Add the code below.
Code:
<script language=Javascript1.2> function ejs_nodroit() {    return(false); } document.oncontextmenu = ejs_nodroit; </script>


is that one better than
Code:
<BODY oncontextmenu="return false">
    </body>


??

because the second one cant be disabled by turning off javascript.
just curious.

SoSweet
New Member

Female Posts : 15
Reputation : 1
Language : English

Back to top Go down

In progress Re: Disable Right Click on HTML page

Post by Sanket on January 21st 2013, 7:28 pm

This code needs to be added to a html page.
Code:
<BODY oncontextmenu="return false">
    </body>

See an example, add this when you create a html page.
Code:
<html>
<head>
<title>My First HTML Page - WebArtz</title>
</head>
<BODY oncontextmenu="return false">
<h1>This is the HTML page header.</h1>
<p>Here is a paragraphi I wrote for my first HTML page.</p>
</body></html>

Sanket
ForumGuru

Male Posts : 48766
Reputation : 2819
Language : English
Location : Mumbai

http://webartzforum.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum