The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Disable Right Click on HTML page

3 posters

Go down

In progress Disable Right Click on HTML page

Post by SoSweet 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 !
avatar
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 January 21st 2013, 5:23 am

https://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
Sanket
ForumGuru

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

Back to top Go down

In progress Re: Disable Right Click on HTML page

Post by SoSweet 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??
avatar
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 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
Sanket
ForumGuru

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

Back to top Go down

In progress Re: Disable Right Click on HTML page

Post by SoSweet 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
avatar
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 January 21st 2013, 7:06 pm

Then add the code in your HTML.
Akkii
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 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
Sanket
ForumGuru

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

Back to top Go down

In progress Re: Disable Right Click on HTML page

Post by SoSweet 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.
avatar
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 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
Sanket
ForumGuru

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

Back to top Go down

Back to top


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