React tutorial in Hindi #17 Handle Form | checkbox | input field | select

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024
  • in this react js tutorial for beginners series we learn how to handle form data in react js . This video is made by anil Sidhu in the Hindi Language.
    Playlist for complete React series in Hindi
    link • React tutorial for beg...
    code github.com/ani...
    Basic Form
    Make HTML form
    Add some field
    Use state for field data
    Submit and control form
    Interview Question
    Join on Insta @php.step.by.step

Комментарии • 57

  • @pratiksha2896
    @pratiksha2896 3 года назад +17

    Use alt+Z to wrap your code. You don't need to scroll the entire line of code.

  • @shorttutorials205
    @shorttutorials205 Год назад +3

    const [disableValue,setdisableValue] = useState(false);
    setdisableValue(true)}>Disable
    setdisableValue(false)}>Enable

  • @Ankitmathur_01
    @Ankitmathur_01 Год назад +6

    Sir ap samjhate bahut achhe se ho and koi bhi part skip nhi krte. And app begining se leke chal rhe ho. Ye bahut achha lga mujhe. Dhanyabad

  • @Viralvlogvideos
    @Viralvlogvideos Год назад +9

    I made a form with radio buttons,checkbox,select etc.. and also made clear button which will clear the inputs from frontend and also in useState sharing it so that other students can also refer:
    code:
    import { useState } from "react";
    function App() {
    const [name, setName] = useState("");
    const [term, setTerm] = useState(false);
    const [who, setWho] = useState("sigma");
    const [what, setWhat] = useState("");
    function formFun(e) {
    console.log(name, term, who, what);
    e.preventDefault();
    }
    function clear() {
    setName("");
    setTerm(false);
    setWho("sigma");
    setWhat("");
    }
    return (

    Name:
    setName(e.target.value)}
    />

    I Agree
    setTerm(e.target.checked)}
    />
    who are you?
    setWho(e.target.value)}
    >
    sigma
    alpha
    omega
    noob

    What you do?
    code
    setWhat(e.target.value)}
    />
    art
    setWhat(e.target.value)}
    />

    Click


    Clear

    );
    }
    export default App;

  • @RadheyNameKaSahara
    @RadheyNameKaSahara 7 месяцев назад +1

    Hi sir, Your voice is really soo sexy, this is a compliment don't take it wrong.😂

  • @AkanshaBhardwaj-fx2zr
    @AkanshaBhardwaj-fx2zr 4 месяца назад

    const [disableValue,setdisableValue] = useState(false);
    setdisableValue(true)}>Disable
    setdisableValue(false)}>Enable
    sir please check the code is correct or not..??

  • @amitshinde4351
    @amitshinde4351 9 месяцев назад +2

    Thanks sir, for helpful video

  • @WanderingWieSuresh
    @WanderingWieSuresh 3 месяца назад

    Abhi to humare pass 3 input the agar 20 honge to kya 20 useState banana padega

  • @rahul_singh_rajput3292
    @rahul_singh_rajput3292 2 года назад +1

    Enjoying & understanding perfectly ✌.. Your explanation is Osm sir..

  • @gauravverma4077
    @gauravverma4077 3 месяца назад

    Thanks sir to learn React

  • @sushilkumar-ef7gh
    @sushilkumar-ef7gh 3 года назад +1

    I recently got to know about your channel....you are simple awesome brother

  • @viveksharma6230
    @viveksharma6230 2 года назад +1

    Will put the "disabled" attribute under the input tag

  • @atulkumarsharma489
    @atulkumarsharma489 2 месяца назад

    Value= name wala nhi aya smj me ky kaam kr rh hai

  • @StudyAbroadAdventures
    @StudyAbroadAdventures 2 года назад +1

    Need help e.preventDefault is creating error plz help:) "Uncaught TypeError: Cannot read properties of undefined (reading 'preventDefault')"

  • @patience_creator
    @patience_creator 7 месяцев назад

    Disable with disabled key word. In input field

  • @Mrudula1416
    @Mrudula1416 3 года назад +1

    Nice and helpful to understand react for begginer user. Thanks

  • @ashutoshsrivastava9807
    @ashutoshsrivastava9807 Год назад

    Njyoing your classes a lot...Thanks for Guidance

  • @reactjs4278
    @reactjs4278 2 года назад +1

    Hello sir, how to clear data on form ??

  • @mayurchaudhari4239
    @mayurchaudhari4239 6 месяцев назад

    Gazab sikhate ho yar aap sir man gaye apko

  • @shilpasharma6894
    @shilpasharma6894 2 года назад +1

    if we want to clear all the form field by clicking the Clear button as you have mentioned in the end of video. please help with its code for clear button.

    • @shubhamgarg7
      @shubhamgarg7 2 года назад

      You should try these points, I hope it will help you - (1) You can create a reset button jo aapke form ko clear krdega (2) Aap form tag mei jo Onsubmit function call kiya hai us function mei jakr wapas se values set krdo sbki fr jaise hi aap form ko submit kroge automatically form clear ho jayega kyunki aapne form submit krne ke baad sbki values fr se set krdi

    • @FM001
      @FM001 Год назад

      Clear

  • @harrypotter-ks5qj
    @harrypotter-ks5qj Год назад

    Sir aapne bataya nhi ki bina form ko use karae hum kaise data ko submit krenge aapne bola tha last me bataunga

  • @sauravsubba9987
    @sauravsubba9987 2 года назад

    Where is the questions and answers? any sepreate video?

  • @GIS-Engineer
    @GIS-Engineer Год назад

    Console pe kuch nahi aa raha na ho koi error aa raha

  • @ajitrana3158
    @ajitrana3158 Год назад

    Sir how to clear data in form

  • @SUNNYVLOGS812
    @SUNNYVLOGS812 Год назад

    what is e here?

  • @AbdulRehman-bd4mb
    @AbdulRehman-bd4mb 11 месяцев назад

    sir without form kis tara data leta hian

  • @PranshuSingh-g6p
    @PranshuSingh-g6p 11 месяцев назад

    You are great teacher

  • @Anonymous04254
    @Anonymous04254 Год назад

    Sir, 9:05 Pe jo Awaaz aayi wo aapne kiya tha ya kuch editing error hua hai..?😄

  • @AmanKumar-ps8th
    @AmanKumar-ps8th 3 года назад +1

    Bt how to print all data to screen
    Here, we only print it in console so please tell me👌

    • @codestepbystep
      @codestepbystep  3 года назад +1

      Just print state data. That's it

    • @AmanKumar-ps8th
      @AmanKumar-ps8th 3 года назад

      import React, { useState } from 'react';
      import './App.css';
      function App() {
      const [name, setName] = useState("");
      const [tnc, setTnc] = useState(false);
      const [interest, setInterest] = useState("");
      const abc = (e) => {
      e.preventDefault();
      }
      const a = (e) => {
      setName(e.target.value);
      }
      const b = (e) => {
      setInterest(e.target.value);
      }
      const c = (e) => {
      setTnc(e.target.checked);
      }
      return (
      handle Form In React
      Select Options
      Marvel
      Dc

      Accept Terms and Conditions
      Submit
      )
      }
      export default App;
      Sir this is the code and I tried bt it is not showing the data on screen so could u please tell me where and what to right in this code so that it works.

    • @codestepbystep
      @codestepbystep  3 года назад +1

      @@AmanKumar-ps8th {name}
      Aise use kro state ko, display ho jayega

    • @AmanKumar-ps8th
      @AmanKumar-ps8th 3 года назад

      Sir yes this is working bt not on submit button . It is printing while u r filling the input box. For this i think we have to add onclick fxn in button

    • @codestepbystep
      @codestepbystep  3 года назад

      Yes, aap iss video se last wala video dekho, wha 1 flag lekr btaya h wo try kro aap

  • @abhijeetnimbalkar9729
    @abhijeetnimbalkar9729 3 года назад

    Nice video and helpful

  • @RajnishKumar-oj3vr
    @RajnishKumar-oj3vr 3 года назад

    Can we use only e.prevent??

  • @Aarna_kashyap
    @Aarna_kashyap 3 года назад

    Very helpful

  • @DeepakGupta-hj2dv
    @DeepakGupta-hj2dv 3 года назад

    Form validation ka video bnao

  • @ashok-bhaargaw
    @ashok-bhaargaw Год назад

    Hi Anil,
    I have #Question.
    I created this form but when I checked the thems and conditions it showing me undefined. Why??

  • @ManishaKumari-du4wf
    @ManishaKumari-du4wf 2 года назад

    Sir console mai warning aa rahi hai : unknown event handler property 'onSumit'.it will be ignored

  • @dipukumar3472
    @dipukumar3472 3 года назад +1

    Sir aap ki insta id not found aa raha he