472,331 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,331 software developers and data experts.

Enable/Disable enter key

hiiiiiiiiiii everybody,
pls solve my problem if u can?
Actualy what happens in my site when i press enter key it will show some secured information related to my site.So for that i have use this code to disable enter key:
Expand|Select|Wrap|Line Numbers
  1.        <script type="text/javascript" language="javascript">
  2.   /*-----script to disable F5 key begin-----*/
  3.     var version = navigator.appVersion;
  4.  
  5.      function showKeyCode(e)
  6.      {
  7.      var keycode =(window.event) ? event.keyCode : e.keyCode;
  8.  
  9.       if ((version.indexOf('MSIE') != -1))
  10.      {
  11.  
  12.      if((keycode == 13))
  13.      {
  14.      if(keycode == 13)
  15.      {
  16.  
  17.       event.keyCode = 0;
  18.      }
  19.      else
  20.      {
  21.       alert ("Sorry");
  22.      }
  23.      event.returnValue = false;
  24.      return false;
  25.      }
  26.      }
  27.      else
  28.      {
  29.      if((keycode == 13))
  30.      {
  31.      if(keycode == 13)
  32.       alert ("Sorry, Enter key is disabled.");
  33.      else
  34.       alert ("Sorry, ");
  35.      return false;
  36.      }
  37.      }
  38.      }
  39.  
  40.  
  41.    window.onload = function() {
  42.     document.onselectstart = function() {return false;} // ie
  43.     document.onmousedown = function() {return false;} // mozilla
  44.     }
  45.    /*-----script to disable text selectiong end----*/
  46.    javascript:window.history.forward(1);
  47.   </script>
  48.  
But now im using searching in my site n for that i want that afer entering text when i press enter key go button for searching has been clicked instead of seperatly clicking go button.
Please help.



Shikha
Dec 23 '08 #1
8 5309
Frinavale
9,735 Expert Mod 8TB
@alamodgal
Instead of disabling the Enter key, consider implementing code that keeps the secured information from displaying. What type of information is it?
Dec 23 '08 #2
hiiiiiiiii
actully im using isapi rewrite url for my site so that i can hide information of different pages like filename and fileid but one problem that i got is that when i just simply use enter key on my site.it will show that complete url of mine including filename and fileid so for that i have disable enter key by using this code.

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" language="javascript">
  2.   /*-----script to disable F5 key begin-----*/
  3.     var version = navigator.appVersion;
  4.  
  5.      function showKeyCode(e)
  6.      {
  7.      var keycode =(window.event) ? event.keyCode : e.keyCode;
  8.  
  9.       if ((version.indexOf('MSIE') != -1))
  10.      {
  11.  
  12.      if((keycode == 13))
  13.      {
  14.      if(keycode == 13)
  15.      {
  16.  
  17.       event.keyCode = 0;
  18.      }
  19.      else
  20.      {
  21.       alert ("Sorry, Ctrl button is disabled.");
  22.      }
  23.      event.returnValue = false;
  24.      return false;
  25.      }
  26.      }
  27.      else
  28.      {
  29.      if((keycode == 13))
  30.      {
  31.      if(keycode == 13)
  32.       alert ("Sorry");
  33.      else
  34.       alert ("Sorry");
  35.      return false;
  36.      }
  37.      }
  38.      }
  39.  
  40.    /*-----script to disable F5 key end-----*/
  41.    /*window.onunload = function() {
  42.     alert('Sorry, page cannot be refreshed.');
  43.     return false;
  44.    }*/
  45.    /*-----script to disable text selectiong begin----*/
  46.    window.onload = function() {
  47.     document.onselectstart = function() {return false;} // ie
  48.     document.onmousedown = function() {return false;} // mozilla
  49.     }
  50.    /*-----script to disable text selectiong end----*/
  51.    javascript:window.history.forward(1);
  52.   </script>
  53.  
  54.  
but now for applying searching on my pages i have to enable enter key so that after entering text when i press enter key go button for searching has been clicked taht actully doesnt happen because of my previous code..


plsssssssss help.
Dec 24 '08 #3
Frinavale
9,735 Expert Mod 8TB
Hi Alamodgal,

Please do not double post your question. It makes it hard for you to get an answer to your problem. I have merged your questions into one thread.

In response to your question, have you seen this article? It covers how to "rewrite" the URL to hide any information displayed in the URL that you may want to keep hidden. I think this would be a better solution to what you're currently doing.

-Moderator Frinny
Dec 24 '08 #4
hiiiiiiiiiiiii
Actually i cant use anything else for url rewrite except isapi rewrite url.
Dec 29 '08 #5
Frinavale
9,735 Expert Mod 8TB
Are you using Helicon Tech's ISAPI Rewrite?
Dec 29 '08 #6
Yes,It is Helicon Rewrite Url
Dec 30 '08 #7
Frinavale
9,735 Expert Mod 8TB
From the research I've done on the topic, I've found that you are going to have to go through your page and rewrite the links so that the file information doesn't show up. Then you need to implement the ISAPI rewrite to translate the links so that the page can retrieve the file.

Check out this article because it contains a lot of information an in depth explanation on how to use Helicon Tech's ISAPI Rewrite. Also, use Helicon Tech Rewrite's Documentation as a reference for developing the url rewrite.
Dec 30 '08 #8
hiiiiiiiiiiii
I have already done url rewriting using this
Dec 31 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Derek White | last post by:
Ok here's the deal. We are finally getting DSL again... but our PC is in the living room... and the youngest has figured out that if he hits the...
3
by: Alphonse Giambrone | last post by:
I am trying to enable/disable a requiredfieldvalidator on the client side and am generating an error. I had found some documentation on validation...
3
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls...
0
by: talal | last post by:
How to check whether javascript is enable or disable in client browser. Remeber i can check wheter browser client support javascript with...
2
by: letam | last post by:
Hello, Thank you in advance for any help, it will be most appreciated! I need to be able to disable several text fields, until the user enters a...
8
by: rongchaua | last post by:
Hi all, i would like now to disable and enable network adapter programmatically with c#. I have searched but found nothing useful. There's no topic...
1
by: scanreg | last post by:
My form needs to (1) direct to specified URLs based on a combination of form selections and (2) enable/disable form features based on selections...
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the...
2
by: Naushad | last post by:
Hi all, I am using the countinous form. I want to Enable/Disable the some fields for perticular records as per the following condition when open...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.