Perform an action on submit