Created
November 5, 2018 17:40
-
-
Save redgeoff/e4a27e3c3ae909b3671728f603dcd842 to your computer and use it in GitHub Desktop.
Autogenerating Forms - Conditional Submit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onSubmit={({ component }) => { | |
// TODO: Contact some API with the data | |
console.log("submitting", component.getValues()); | |
// Simulate response from API saying that email address is already in use and report this | |
// error to the user | |
if (component.get("fields.email.value") === "[email protected]") { | |
component.set({ "fields.email.err": "already in use" }); | |
} else { | |
// Everything was successful so redirect, show confirmation, etc... | |
} | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment