JQuery function not performing as expected

Posted on 2012-09-20
Last Modified: 2012-09-21
I am new to JQuery and I have a simple page to "play" with JQuery and I can't get this to work.  I simply have an textbox with a submit button on a form.  I wrote a JQuery that is supposed to do an alert everytime a key is pressed.  I'm not getting the alert.  In addition, if the class is set to "no-edit" then it returns false so it shouldn't accept input on the text box.  This isn't working either.  Can someone tell me what I'm doing wrong?  I am not getting any errors on the page and when I debug the page it never enters my JQuery code.  My file exists in a folder c:\my projects\JQuery Test\test.asp;  The JQuery file is in C:\my projectes\libs\jquery\jquery-1.7.2.min.js.  Here is my page: (Any help is greatly appreciated!)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/libs/jquery/jquery-1.7.2.min.js"></script>
<script language="JavaScript">
      var ctrlDown = false;
      var pasteFlag = false;
      var ctrlKey = 17, vKey = 86;
            alert("key down");
            alert("Ctrl False");
            return false;
<title>JQuery Test</title>

<form name="test" method="post" action="test.asp" target="_self">
      <input name="textbox" id="textbox" size="12" class="no-edit" />
      <input name="submit" id="submit" type="submit" value="Submit" />
Question by:dyarosh
    LVL 81

    Accepted Solution

    replace : $document.ready(function()
    by : $(document).ready(function()

    Author Closing Comment

    Can't tell you how many times I read that line and didn't catch the missing ().  Thank you.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now