Is it possible to clear the signature canvas using JS?

Neil Manchester:
Is it possible to clear the signature canvas when the page reloads? I’ve tried clearing model.signature but the signature is still visible on the canvas. Need to clear it as I have use cases where a user has to complete multiple forms on the same page.


Eduardo Aramizu:
I’m not sure if this is the best way to do it, but it’s possible to use the embedded clear button that’s part of the signature pad component and have a function like this

var clearSignButtonEl = document.getElementsByClassName('btn btn-primary sig-clear');
clearSignButtonEl[0].click();

@Delfs might be able to give a cleaner solution, if there’s one


Delfs:
If the above works, then that could be easiest. Basically hit the clear method of that library.


Neil Manchester:
Yeah that works. Thanks @Eduardo Aramizu


Eduardo Aramizu:
Great, no problem