I have read a few posts on positioning the caret, but none seem to answer my particular issue.
It sounds like you are trying to do an inline edit... have you looked at the jeditable plugin?