CenterForDigitalHumanities / CenterForDigitalHumanities/deer
Form reset() Override
- 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
Assessment
This issue has not been assessed yet.