NA +91-8727899942 thecoderjob@gmail.com

CHAPTER - 15

Form handle

  • Example :

function Form() {

  const [name,setName]=useState("");

  function getFormData(e){

    e.preventDefault()

  }

  return (

    <>

     <h1>Handle Form in React</h1>

     <form onSubmit={getFormData}>

       <input type="text" placeholder="enter name" value={name} onChange={(e)=>setName(e.target.value)} />

       <button type="submit">Submit</button>

     </form>

    </div>

  );

}

 

Chapter 14

Show & Hide experiment

Previous chapter

Chapter 16

If-Else condition

Next chapter

Get In Touch

NA

thecoderjob@gmail.com

+91-8727899942

Popular Links

© www.thecoderjob.com. All Rights Reserved.               Designed by HTML Codex