Skip to content
Junior–Senior164 views

Button is active only after filling in all fields

Task condition

It is necessary to make the button disabled until the user enters data into both text fields and checks the checkbox.

function App() {
  const [formState, setFormState] = React.useState();

  return (
    <>
      <h1>Disable button</h1>
      <input type="text" />
      <input type="text" />
      <input type="checkbox" />
      <button>submit</button>
    </>
  );
}
Frontend tasks in the code trainer