User edit: Improve JavaScript and form

[ci skip]