change onsubmit to addEventListener

Prevents overriding of onsubmit function specified by user [abhinavdahiya]