It seems that sometimes (but not always) my button click event is being fired twice. The fact that it seems to happen sometimes but not always is really puzzling me. Here is m
It is because the button type is submit. You need to change it to button to solved the button events triggering twice. Refer this blog for further explanation.