add new callback before submit button
Merge branch '4.0/beforesubmit-callback' into 4.0-trunk