jquery text box keypress event
<p>What I really want to do is run a function on every input box in a table.  The table has a class BudgetTable so I though </p>

<pre><code>$(".BudgetTable tr input:text").keypress...
</code></pre>

<p>would work but in VS2010 the breakpoint was not hitting.</p>

<p>So I create a simple page to make sure it wasn't the mark up and so I can post something here that isn't too complex.</p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Budget.aspx.cs" Inherits="BudgetApplicationWeb.Budget" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//Dth XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/Dth/xhtml1-transitional.dth"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head id="Head1" runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;script src="Scripts/jquery-1.4.1.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;link href="Styles/BudgetGrid.css" rel="stylesheet" type="text/css" /&gt;
    &lt;script  type="text/javascript"&gt;
    window.my_config = 
    { 
        last_section : "",
        current_section_row:0
    };

    $(document).ready(function () {
        $("tr").each(function (index, domElem) {
            var className = $(this).attr("class");
            if (className == window.my_config.last_section) {

                window.my_config.current_section_row++;

                if (window.my_config.current_section_row % 2 == 0) {
                    $(this).addClass("alt");
                }

            }
            else if (className != "") {
                window.my_config.last_section = className;
                window.my_config.current_section_row = 0;
                if (window.my_config.last_section.toString().substr(0, 6) == "DataTR") {
                    $(this).addClass("alt");
                }
            }
        });
    });

    $("input").keypress(function (event) {
        var className = $(this).attr("class");
        var str = "";

        str += "ClassName:" + className + "&lt;BR&gt;"
        str += "ParentItem:" + className.toString().replace("Item", "") + "&lt;BR&gt;"

        // $("#debug").text = str;
        $("#debug").text = "hello";
    });
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;   
    &lt;div id="debug"&gt;
        &lt;asp:TextBox ID="TextBox3" runat="server" /&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I looked at the post</p>

<p><a href="http://stackoverflow.com/questions/638206/how-do-i-select-all-text-boxes-in-a-table-excluding-the-last-one-in-the-table-row">How do I Select all text boxes in a table excluding the last one in the table row with JQuery</a></p>

<p>I can not figure out why keypress is not working.</p>

<p>Thanks for the help</p>
