Allow edit a value
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
editable-input.js Added HTML type Sep 10, 2014 Initial commit Sep 10, 2014

Editable input

Allow to edit a resource property value in a REST application sending PUT requests


<h3 data-object="post" data-property="title" data-url="/posts/1">Title here</h3>
new EditableInput(document.querySelector('h3'));

When you edit the value using double click without cancelling you send a request like:

PUT /posts/1
post[title]=New title

If the request is successfull it assumes the value has been saved, and allows cancellation.