更改jquery元素值的问题

Ive got a table were the user can click on a row and the row id is posted using jquery. The data associated with the row id is placed in a session then a form pops up (again using jquery) with the values but when the form is closed and I click another row the values do not change. Can't figure out a way round it!

I just want to understand this properly: if I click on the row with the ID "TOWN_EDIT" then the value of that row should be set to its ID (in this case, "TOWN_EDIT"). Is that correct?

If that's the behavior you're looking for, you have to set the value of the $("#TOWN_EDIT") element at some point, like this:

$("#TOWN_EDIT").val( "TOWN_EDIT" ); // or however you'd like to specify the value

So, once the POST response comes back successfully, make sure to update your values.

Let me know if I'm misunderstanding things, or if you have a demo I can check out.