--- includeMockServer: true title: "Edit in Place" description: Update a record without page refresh icon: "icon-[mdi--square-edit-outline]" soon: true ---
## Basic usage On the client, display the current values with a button that fetches the edit form. ```html

Name: Joe Smith

Email: joe@smith.org

``` - [`hx-target`](/reference/attributes/hx-target)=[`"this"`](/reference/attributes/hx-target#this) sets the target to the `
` itself. - [`hx-swap`](/reference/attributes/hx-swap)=[`"outerHTML"`](/reference/attributes/hx-swap#outerhtml) replaces the entire `
` with the response. - [`hx-get`](/reference/attributes/hx-get) on the button requests the edit form. On the server, respond with a form pre-filled with the current values. ```html
``` - [`hx-put`](/reference/attributes/hx-put) submits the form as a `PUT` request. - **Save** submits the form, and the server responds with the updated view mode HTML. - **Cancel** re-fetches the view mode without saving. ## Notes ### REST conventions The endpoints follow standard REST conventions: - `GET /users/1`: retrieve the view - `GET /users/1/edit`: retrieve the edit form - `PUT /users/1`: update the resource The URL represents the resource, and the HTTP method indicates the action.