Enable/Disable enter key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alamodgal
    New Member
    • Dec 2008
    • 38

    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:
    [code=javascript]
    <script type="text/javascript" language="javas cript">
    /*-----script to disable F5 key begin-----*/
    var version = navigator.appVe rsion;

    function showKeyCode(e)
    {
    var keycode =(window.event) ? event.keyCode : e.keyCode;

    if ((version.index Of('MSIE') != -1))
    {

    if((keycode == 13))
    {
    if(keycode == 13)
    {

    event.keyCode = 0;
    }
    else
    {
    alert ("Sorry");
    }
    event.returnVal ue = false;
    return false;
    }
    }
    else
    {
    if((keycode == 13))
    {
    if(keycode == 13)
    alert ("Sorry, Enter key is disabled.");
    else
    alert ("Sorry, ");
    return false;
    }
    }
    }


    window.onload = function() {
    document.onsele ctstart = function() {return false;} // ie
    document.onmous edown = function() {return false;} // mozilla
    }
    /*-----script to disable text selectiong end----*/
    javascript:wind ow.history.forw ard(1);
    </script>
    [/code]

    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
    Last edited by Frinavale; Dec 23 '08, 02:38 PM. Reason: Added [code] tags. Thread moved to ASP.NET forum
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Originally posted by alamodgal
    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:
    Instead of disabling the Enter key, consider implementing code that keeps the secured information from displaying. What type of information is it?

    Comment

    • alamodgal
      New Member
      • Dec 2008
      • 38

      #3
      Enable/Disable enter key

      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.

      [code=javascript]
      <script type="text/javascript" language="javas cript">
      /*-----script to disable F5 key begin-----*/
      var version = navigator.appVe rsion;

      function showKeyCode(e)
      {
      var keycode =(window.event) ? event.keyCode : e.keyCode;

      if ((version.index Of('MSIE') != -1))
      {

      if((keycode == 13))
      {
      if(keycode == 13)
      {

      event.keyCode = 0;
      }
      else
      {
      alert ("Sorry, Ctrl button is disabled.");
      }
      event.returnVal ue = false;
      return false;
      }
      }
      else
      {
      if((keycode == 13))
      {
      if(keycode == 13)
      alert ("Sorry");
      else
      alert ("Sorry");
      return false;
      }
      }
      }

      /*-----script to disable F5 key end-----*/
      /*window.onunloa d = function() {
      alert('Sorry, page cannot be refreshed.');
      return false;
      }*/
      /*-----script to disable text selectiong begin----*/
      window.onload = function() {
      document.onsele ctstart = function() {return false;} // ie
      document.onmous edown = function() {return false;} // mozilla
      }
      /*-----script to disable text selectiong end----*/
      javascript:wind ow.history.forw ard(1);
      </script>

      [/code]

      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.
      Last edited by Frinavale; Dec 24 '08, 04:10 PM. Reason: added [code] tags

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        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

        Comment

        • alamodgal
          New Member
          • Dec 2008
          • 38

          #5
          hiiiiiiiiiiiii
          Actually i cant use anything else for url rewrite except isapi rewrite url.

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Are you using Helicon Tech's ISAPI Rewrite?

            Comment

            • alamodgal
              New Member
              • Dec 2008
              • 38

              #7
              Yes,It is Helicon Rewrite Url

              Comment

              • Frinavale
                Recognized Expert Expert
                • Oct 2006
                • 9749

                #8
                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.

                Comment

                • alamodgal
                  New Member
                  • Dec 2008
                  • 38

                  #9
                  hiiiiiiiiiiii
                  I have already done url rewriting using this

                  Comment

                  Working...