Detect form button in JS form submission handler