Skip to content

Commit

Permalink
summit the form as well to show it works
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Sep 21, 2024
1 parent 9518624 commit d42e67c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export default function SignInCard() {
};

const handleSubmit = (event) => {
event.preventDefault();
if (emailError || passwordError) {
event.preventDefault();
return;
}
const data = new FormData(event.currentTarget);
console.log({
email: data.get('email'),
Expand Down Expand Up @@ -99,6 +102,7 @@ export default function SignInCard() {
</Typography>
<Box
component="form"
method="POST"
onSubmit={handleSubmit}
noValidate
sx={{ display: 'flex', flexDirection: 'column', width: '100%', gap: 2 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export default function SignInCard() {
};

const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
if (emailError || passwordError) {
event.preventDefault();
return;
}
const data = new FormData(event.currentTarget);
console.log({
email: data.get('email'),
Expand Down Expand Up @@ -99,6 +102,7 @@ export default function SignInCard() {
</Typography>
<Box
component="form"
method="POST"
onSubmit={handleSubmit}
noValidate
sx={{ display: 'flex', flexDirection: 'column', width: '100%', gap: 2 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ export default function SignIn(props) {
};

const handleSubmit = (event) => {
event.preventDefault();
if (emailError || passwordError) {
event.preventDefault();
return;
}
const data = new FormData(event.currentTarget);
console.log({
email: data.get('email'),
Expand Down Expand Up @@ -123,6 +126,7 @@ export default function SignIn(props) {
</Typography>
<Box
component="form"
method="POST"
onSubmit={handleSubmit}
noValidate
sx={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ export default function SignIn(props: { disableCustomTheme?: boolean }) {
};

const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
if (emailError || passwordError) {
event.preventDefault();
return;
}
const data = new FormData(event.currentTarget);
console.log({
email: data.get('email'),
Expand Down Expand Up @@ -123,6 +126,7 @@ export default function SignIn(props: { disableCustomTheme?: boolean }) {
</Typography>
<Box
component="form"
method="POST"
onSubmit={handleSubmit}
noValidate
sx={{
Expand Down

0 comments on commit d42e67c

Please sign in to comment.