How can I conditionally prevent users from submitting the form based on another input