I’m trying to create a Live Table Edit with Jquery but I’m having trouble with getting it to fire on my td’s rather then the tr
Here is my code.
http://jsfiddle.net/y7Zck/1/
This works almost as intended. What I would like to change is so that the function doesn’t fire if you hit the frameTot with value 150 in this example. You should only be able to click on the first two fields and get the edit boxes to show. How would I go about doing this?
My attempt to change
$(".edit_tr").click(function()
to
$(".edit_td").click(function()
Doesn’t seem to help at all.
Your script is accessing
$(this).attr('id')which (of course) isn’t the same for your td as it is for your tr.You need to update both listeners to use something like
$(this).closest('tr').attr('id')orparseInt($(this).attr('id'), 10)(grabbing just the number-part from your td’s ID).