Buttons for live-manipulation within edit mode

Buttons for live-manipulation within edit mode

I'd like to create a button which is similar to the existing "copy address".
I'd like to have a button that is pushing moving the value of field1 into field2 and put something new into field1.

So far I just know the buttons at the top of the edit page, but those cause two issues:
1. It doesn't handle information that just has been entered (unstored)
2. changes through those buttons seem not to be visible until I reload the page.

Is there any solution to this?