Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

JQuery function not performing as expected

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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<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" />
1 Solution
replace : $document.ready(function()
by : $(document).ready(function()
dyaroshAuthor Commented:
Can't tell you how many times I read that line and didn't catch the missing ().  Thank you.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now