When I run my submit and save I get two outputs. I added a string to my code to give it some context and when I do this is outputs twice. When I remove the string and just have console.log(val); it works just fine, one output.
So my question is why does it run the output twice? I have no idea.
Replace this line with your code.