[minor] added before_submit method in js
[minor] added before_submit method in js