refactor js submit code for signatures, added button