I have a form with 2 text boxes that all do the same thing. They each call the JQuery function below after each keypress. Since I have 2 textboxes that all do the same thing, I’d like this function to work for both. How do I change this function so that it’ll grab the textbox’s ID that is currently being edited instead of just the one?
The part where I’d like to insert my textbox’s id is '#DocId'.
$(function() {
$('#DocId').live('keydown', function() {
var styleValue = $(this).val();
$('#tableContent').load(
'/CurReport/TableResults',
{ style: styleValue }
);
})
});
Here is my HTML:
<td><%= Html.TextBox("DocId") %></td>
<td><%= Html.TextBox("LangCode") %></td>
Thank you,
Aaron
Based on your edit, this will work:
This is assuming they all use
#tableContent, if not then it’ll need to be able to get at an attribute on something to determine that.