Skip to content

Commit

Permalink
Login form | html5 validation trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Oct 21, 2021
1 parent ffc900e commit 6ade9df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/users/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class Login extends React.Component {

handleSubmit = event => {
event.preventDefault()
const form = document.getElementsByTagName('form')[0];
form.reportValidity()
const { username, password } = this.state;
if(username && password)
this.handleLogin(username, password)
Expand Down

0 comments on commit 6ade9df

Please sign in to comment.