title: Cannot get Javascript function to fire from a textbox in a gridview
body: <p>I have a textbox in the ItemTemplate of a Gridview.  On the _RowDataBound event I add an attribute to the textbox like so:</p>
  
  <pre><code>TextBox txtQuantity = (TextBox)e.Row.FindControl("txtQuantity");
  txtQuantity.Attributes.Add("onkeypress", "CheckInputForNumeric(event)"); 
  </code></pre>
  
  <p>And it simply will not fire a JS function.</p>
  
  <p>I've tried doing onClick, onBlur, onKeyPress... even tried changing the case to: onclick, onblur, onkeypress...  nothing seems to be able to fire my JS function.</p>
  
  <p>elsewhere on that same page I have:</p>
  
  <pre><code>    txtAddMarkup.Attributes.Add("onkeypress", "CheckInputForNumeric(event)");
  </code></pre>
  
  <p>(that textbox is not in a gridview)
  and this works just fine.</p>
  
  <p>I'm totally stuck and frustrated at this point because it seems no matter what I do, I cannot get this textbox to fire a JavaScript function</p>