Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why "event.preventDefault" onSubmit? #30

Open
budodi opened this issue May 25, 2019 · 0 comments
Open

Why "event.preventDefault" onSubmit? #30

budodi opened this issue May 25, 2019 · 0 comments
Labels
question Further information is requested

Comments

@budodi
Copy link

budodi commented May 25, 2019

Given the example below:

onSubmitTask = event => {
  event.preventDefault(); // Why this?

  const task = {
    description: event.target[0].value,
    time: event.target[1].value,
    isComplete: false
  };
}

Questions:

  • How bad is the default behavior?
  • What if we leave it there?

See: #10

@joshuamabina joshuamabina changed the title why use "event prevent default" behaviour onSubmit? Why "event.preventDefault" onSubmit? May 26, 2019
@joshuamabina joshuamabina added the question Further information is requested label May 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants