CenterForDigitalHumanities / CenterForDigitalHumanities/deer

Form reset() Override

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
enhancement OSS
Dominant language
JavaScript
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

When DEER needs to reset a form, it really means

```javascript
LR.utils.scrubForm = function(form){
form.removeAttribute("deer-id")
form.removeAttribute("deer-source")
form.querySelectorAll(LR.INPUTS.join(",")).forEach(i => {
//Anything you need to ignore should go here
if(i.getAttribute("type") !== "submit" && i.getAttribute("deer-key") !== "creator"){
i.value = ""
i.removeAttribute("deer-source")
i.removeAttribute("deeer-id")
}
})
}
```

We should be able to put some flag on a form so it knows to do this upon submission so that this form will create a new object on the next submissions, not update the object it just made.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.