http://feeds.feedburner.com/SpendYourTimeHere-Once

Current Affiares

Showing posts with label JAVA SCRIPT. Show all posts
Showing posts with label JAVA SCRIPT. Show all posts

Friday, July 20, 2012

How to disable copy and paste from javascript in textfield?

<head>
        <script language="javascript">
            function DisableRightClick(event)
            {
                //For mouse right click
                if (event.button==2)
                {
                    alert("Right Clicking not allowed!");
                }
            }
            function DisableCtrlKey(e)
            {
                var code = (document.all) ? event.keyCode:e.which;
                var message = "Ctrl key functionality is disabled!";
                // look for CTRL key press
                if (parseInt(code)==17)
                {
                    alert(message);
                    window.event.returnValue = false;
                }
            }
        </script>
</head>

<body>
  <h:inputText  onmousedown="DisableRightClick(event)" onkeydown="return DisableCtrlKey(event)" /> 
</body>

Monday, July 16, 2012

How to disable back button of your browser window through java script?

Que. How to disable back button of your browser window through java script?
Ans.
<head>
<SCRIPT type="text/javascript">
            window.history.forward();
            function noBack() { window.history.forward(); }
        </SCRIPT>
</head>
<body onload="noBack()"  onunload="">

My Blog List

Popular Posts

All Rights Reserved To SYTHONCE. Ethereal theme. Powered by Blogger.